2
我用下面的規範試行「早該」上的RSpec的頂部(軌道3):早該應該「有效」做失敗,「‘handle_matcher’:未定義的方法‘能匹配?’」
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
和
0123我的測試將運行得很好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,所以據我所知應該是加載好的。
有什麼建議嗎?
好吧,所以我'只是'與Test :: Unit vs Rspec語法混淆 - 感謝指出:-) – 2010-09-10 08:33:03