Rspec-mocks有expect(some_object).to receive(:some_method).and_call_original
。我可以用摩卡这样做,如果是的话,怎么样? some_object.expects(:some_method)....
......什么?
答案 0 :(得分:9)
我很确定没有办法做到这一点。
查看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.