I'm trying to stub a third party service that my metal talks to. It seems rspec mocks/stubs don't extend all the way to the Metal.
When I call stubbed methods on objects, it calls the original one and not the stubbed one.
Any idea of how I can have rSpec doubles extend all the way 开发者_JAVA百科to the metal?
Thanks.
-Nash
Have you considered using Fakeweb instead? This allows you to block all outgoing traffic and send a custom response instead. This way you don't even have to write a mock. It's very lightweight and easy to use.
You can also try using WebMock http://github.com/bblimke/webmock
精彩评论