Displaying 1 result from an estimated 1 matches for "google_search_california".
2006 Dec 21
4
Stubbing Kernel#open
Anyone know how to stub Kernel#open? I''m trying to mock/stub an
open-uri call, but it doesn''t seem to like it.
Here''s the test code, and the failures:
body = File.open(File.dirname(__FILE__) +
''/../fixtures/google_search_california.html'').read
Object.any_instance.expects(:open).with(''http://www.google.com/search?q=california'').returns(stub(:body
=> body))
@response = GoogleSearch.new(''california'')
assert_equal body, @response.body
1) Failure:
test_new(GoogleSearc...