1
我收到以下錯誤消息:邁克爾·哈特爾指南第6章語法錯誤user_spec.rb
rails_projects/sample_app/spec/models/user_spec.rb:6: syntax error, unexpected ',', expecting ')'
@attr = (:name => "Example User", :email => "[email protected]")
後,我的設置,只有設置了user_spec.rb文件 需要「spec_helper」
describe User do
before(:each) do
@attr = (:name => "Example User", :email => "[email protected]")
# pending "add seme examples to (or delete) #{__FILE__}"
end
it "should create a new instance given valid attributes" do
User.create!(@attr)
end
it "should require a name"
end
我知道我仍然會在代碼中收到待處理消息,但不會出現語法錯誤
@matt,答案是否適合你? – Zabba 2011-06-30 19:00:56