【发布时间】:2010-09-09 14:17:06
【问题描述】:
我正在使用以下规范在 rspec(rails 3)之上尝试“应该”:
require 'spec_helper'
describe Article do
should "be true" do
assert true
end
end
它失败了
/Users/jeppe/.rvm/gems/ruby-1.8.7-p302/gems/rspec-expectations-2.0.0.beta.20/lib/rspec/expectations/handler.rb:11:in `handle_matcher': undefined method `matches?' for "be true":String (NoMethodError)
现在我的测试将在我同时进行时运行良好
require 'spec_helper'
describe Article do
it "should be true" do
assert true
end
end
和
require 'spec_helper'
describe Article do
it { should belong_to :issue }
it { should have_and_belong_to_many :pages }
it { should have_many :tasks }
end
最后一个使用 Shoulda::ActiveRecord::Matchers 的地方,所以据我所知应该可以正常加载。
有什么建议吗?
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 rspec shoulda