私は次の仕様でrspec(rails 3)の上に「shoulda」を試しています:
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を使用しているので、私の知る限り、shouldaは問題なくロードされます。
助言がありますか?