Skip to content

Instantly share code, notes, and snippets.

@mbleigh
Created September 21, 2009 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mbleigh/190050 to your computer and use it in GitHub Desktop.
Save mbleigh/190050 to your computer and use it in GitHub Desktop.
require 'fakeweb'
FakeWeb.allow_net_connect = false
class SomethingThatUsesNetHTTP
def self.some_http_method
# => does hidden-away HTTP stuff
end
end
> SomethingThatUsesNetHTTP.some_http_method
FakeWeb::NetConnectNotAllowedError: Real HTTP connections are disabled.
Unregistered request: GET http://some.url.here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment