search for: webmock

Displaying 4 results from an estimated 4 matches for "webmock".

Did you mean: webdock
2010 Aug 29
0
Troll - A Rails plugin for making webservice mocking easier
Hi Folks, Troll trumps your existing ActiveResource mocking libraries like inbuilt HttpMock,Fakeweb or Webmock out of water. With Troll, ActiveResource mocking just works, some of its features: 1. Don''t need to mock calls at Net::HTTP level (which webmock,fakeweb do). Really, we don''t care what HTTP library ActiveResource uses, fakeweb and webmock bring additional complexity because of p...
2011 Feb 16
3
stubbing gets undone?
...uot;should not hit the web" do @premise.lookup_things_on_the_web.should_not raise_exception end end ---- When I run the test, I see: just stubbed #<Premise id: 1, user_id: 1, ...> entering lookup_stuff_on_the_web with #<Premise id: 1, user_id: 1, ...> Failure/Error: ... WebMock::NetConnectNotAllowedError: As far as I can see, the Premise that''s being stubbed and the Premise whose lookup_stuff_on_the_web method is getting called are one and the same. What I can''t figure out is why the stub isn''t being honored. (FWIW, the same setup code is work...
2013 Jun 09
2
Minitest mock or stub methods
Hi I''m building a small library to use in my Rails app which interacts with a 3rd party API. It fetches artists and tracks. So I have: lib/my_lib.rb lib/my_lib/artist.rb lib/my_lib/track.rb To get an artist I do artist = MyLib::Artist.find("Oasis") Which returns an instance of Artist if it finds (via 3rd party API) it or nil otherwise. Then I can call artist.tracks which
2012 Jan 15
1
How to mock out a WEBrick::HTTPServer?
partial code : http://pastie.org/3186140 I want to test a HTTP server, I''m using lower level stuff so I can understand whats going on, then I might move onto FakeWeb/WebMock/etc Its a reverse proxy, so it doesn''t generate the page content. I want to test a/ methods in the class in isolation b/ test that if a HTTP request sent in generates a HTTP request out (suppose should be just a method to test) c/ and that the HTTP response given to the proxy with body i...