0
在我的一個測試中,我想執行before :all
操作,並且還需要測試在此before :all
操作中未調用的方法。有沒有辦法做到這一點?在RSpec中調用stubbed方法時設置變量
例如我希望能夠到:
before :all do
@bar_called = false
# set @bar_called to true if bar is called on an instance of class Foo
do_other_stuff
end
,然後在以後我的規格之一,預計@bar_called == false