Skip to content

Instantly share code, notes, and snippets.

@sandro
Created April 10, 2012 20:09
Show Gist options
  • Save sandro/2354128 to your computer and use it in GitHub Desktop.
Save sandro/2354128 to your computer and use it in GitHub Desktop.
EphemeralResponse.mock('google.com') do |domain|
domain.on('get') do |request|
if query = request.query[:q]
puts "searching for #{query}"
Net::HTTPSuccess.new
else
nil # pass through, raise ExternalRequest or whatever normally happens
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment