mbleigh (owner)

Revisions

gist: 190050 Download_button fork
public
Public Clone URL: git://gist.github.com/190050.git
Embed All Files: show embed
abuse_fakeweb.rb #
1
2
3
4
5
6
7
8
require 'fakeweb'
FakeWeb.allow_net_connect = false
 
class SomethingThatUsesNetHTTP
  def self.some_http_method
    # => does hidden-away HTTP stuff
  end
end
what_happens.txt #
1
2
3
> SomethingThatUsesNetHTTP.some_http_method
FakeWeb::NetConnectNotAllowedError: Real HTTP connections are disabled.
  Unregistered request: GET http://some.url.here