0
任何想法,爲什麼這個工程:RSpec的:使用view.should_receive主題爲
it {view.should_receive(:update_method)}
但這並不?:
subject { view }
it { should_receive(:update_method) }
其他一切是相同的。我得到這個錯誤:
Failure/Error: it {should_receive(:update_method)
(#<RSpec::Core::ExampleGroup::Nested_1:0x7faf27602d58>).update_method
expected: 1 time
received: 0 times
但我不知道是什麼RSpec ::核心:: ExampleGroup ::嵌套....指的是。有任何想法嗎?
在此先感謝!
謝謝。這清除了一切。在我有機會濫用後鉤太久之前重定向是件好事。我仰望模擬期望,但不能真正掌握should_receive與其他預期之間的區別。有關於此的任何快速指針?再次感謝並保重! –
什麼是「後期清理」的好例子。我想不出什麼時候應該正確使用後鉤。回滾數據庫修改?再次感謝! –