开发者

Testing Rails Metal With Cucumber/rSpec

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜