[rspec-users] how to mock a Net::Http object?

Zhenning Guan lists at ruby-forum.com
Tue Mar 2 03:39:03 EST 2010

one_data = Net::HTTP.post_form(URI.parse(country_site), {'country' =>
two_data = Net::HTTP.post_form(URI.parse(visit_site), {'country' =>

I have a code similar like above code in my application, so how to mock
a a object like above? if only post_from once, I just need to stub
post_form, but now, it has different parameter, how to do it?

Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list