我正在尝试在我的rails (5.0.1)应用程序中使用ruby 2.5.0-p0 (x86_64-linux )Comment
测试我的模型的委托方法)
并收到此错误:
1) Comment delegation
Failure/Error: it { should delegate_method(:name).to(:user).allow_nil }
NoMethodError:
undefined method `allow_nil' for #<Shoulda::Matchers::Independent::DelegateMethodMatcher:0x00005587de5bc488>
# ./spec/models/comment_spec.rb:11:in `block (3 levels) in <top (required)>'
Finished in 0.00225 seconds (files took 3.62 seconds to load)
1 example, 1 failure
代码非常简洁明了,我认为库而不是我的实现代码可能存在一些错误。有谁知道这里出了什么问题?谢谢!