我将我的升级rspec-rails
到 3.0.1,现在我在所有测试中都看到了这个错误
Failure/Error: Sidekiq::Status::complete?(json.jid).should be_true
expected true to respond to `true?`
我找不到解决方案,也找不到我所缺少的。
我将我的升级rspec-rails
到 3.0.1,现在我在所有测试中都看到了这个错误
Failure/Error: Sidekiq::Status::complete?(json.jid).should be_true
expected true to respond to `true?`
我找不到解决方案,也找不到我所缺少的。
从 rspec 3.0 开始,be_true
被重命名为be_truthy
和be_false
be_falsey
行为没有改变。所以
(nil).should be_falsey
(false).should be_falsey
将通过,并且
(anything other than nil or false).should be_truthy
也会通过
从更新日志 3.0.0.beta1 / 2013-11-07
将 be_true 和 be_false 重命名为 be_truthy 和 be_falsey。(山姆·菲蓬)
为了不重写很多现有的规范,您可以将其添加到 spec_helper (它损害了我的和谐感但节省了时间):
def true.true?
true
end
def true.false?
false
end
def false.true?
false
end
def false.false?
true
end