Rspec-mocks有expect(some_object).to receive(:some_method).and_call_original。我能用Mocha做这件事吗?如果可以,怎么做?some_object.expects(:some_method).... ...what?
发布于 2014-03-29 14:29:20
我非常确定没有办法做到这一点。
浏览一下source code,有一条注释提到原来的方法被完全替换了。
# The original implementation of the method is replaced during the test and then restored at the end of the test. The temporary replacement method has the same visibility as the original method.https://stackoverflow.com/questions/21715174
复制相似问题