Created
March 20, 2010 14:36
-
-
Save barinek/338700 to your computer and use it in GitHub Desktop.
Net::HTTP Mock
This file contains 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
http_mock = mock('Net::HTTPResponse') | |
http_mock.stubs(:code => '200', :body => 'response body', :message => 'response message') | |
Net::HTTP::Post.any_instance.expects(:body=).with("post body").once | |
Net::HTTP.any_instance.expects(:request).with(anything).once.returns(http_mock) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment