为什么这行得通的任何想法:
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::Core::ExampleGroup::Nested.... 指的是什么。有什么想法吗?
提前致谢!
最佳答案
这是 24 小时内第二次出现此问题。空气中有东西。参见 https://github.com/rspec/rspec-mocks/issues/148求解释。
关于ruby-on-rails - RSpec:将 view.should_receive 与主题一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10941455/