我有這個在我的測試怎麼說「should_receive」多次在RSpec的
Project.should_receive(:find).with(@project).and_return(@project)
,但是當對象收到方法調用兩次,我所要做的
Project.should_receive(:find).with(@project).and_return(@project)
Project.should_receive(:find).with(@project).and_return(@project)
有什麼方式如何說出類似於
Project.should_receive(:find).with(@project).and_return(@project).times(2)
似乎這可能不適用於'any_instance'? – 2013-12-23 22:26:15
@JaredBeck爲什麼? – 2014-01-03 12:42:17
@YoLudke我不知道 – 2014-01-03 18:04:34