【发布时间】:2014-05-16 06:08:21
【问题描述】:
您好,我正在尝试使用 rspec 中的以下源代码在控制器中存根始终返回 true 的 around_filter 方法
before(:each) do
controller.stub(:catch_exceptions).and_return(true)
end
after(:each) do
controller.stub(:catch_exceptions).and_return(true)
end
但它失败了。当我将特定方法更改为 before_filter 时,它可以正常工作吗?谁能帮帮我?
【问题讨论】:
标签: ruby-on-rails ruby rspec tdd rspec2