one_data = Net::HTTP.post_form(URI.parse(country_site), {'country' =>
"american"})
two_data = Net::HTTP.post_form(URI.parse(visit_site), {'country' =>
"english"})
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?
Net::HTTP.stub!(:post_form).and_return('my_data')
on 2010-03-02 09:39
on 2010-03-02 09:52
On Tue, Mar 2, 2010 at 9:39 AM, Zhenning Guan <lists@ruby-forum.com> wrote: > one_data = Net::HTTP.post_form(URI.parse(country_site), {'country' => > "american"}) > two_data = Net::HTTP.post_form(URI.parse(visit_site), {'country' => > "english"}) > > 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? > > http://github.com/blaine/fakeweb Aslak
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.