Created
January 21, 2011 18:33
-
-
Save cheeyeo/790144 to your computer and use it in GitHub Desktop.
Generic webmock methods inside spec_helper.rb for rspec tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inside spec_helper.rb | |
def enable_http_request | |
WebMock.reset! | |
WebMock.allow_net_connect! | |
end | |
def disable_http_request | |
WebMock.reset! | |
WebMock.disable_net_connect! | |
end | |
# usage inside your own spec files | |
# before do | |
# enable_http_request | |
# end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment