Rspec-mocks有expect(some_object).to receive(:some_method).and_call_original.我可以用摩卡这样做,如果是的话,怎么样?some_object.expects(:some_method).......什么?
Ben*_*ett 11
我很确定没有办法做到这一点.
通过源代码查看,有一条评论提到原始方法已被完全替换.
# 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.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1283 次 |
| 最近记录: |