我有这个代码:https ://github.com/roelof1967/tamara 但是当我做黄瓜时,它会失败并显示此错误消息:https ://gist.github.com/4008123
谁能向我解释我的代码有什么问题?
罗洛夫
编辑1:失败的代码:
class Output
def messages
@messages ||= []
end
def puts(message)
messages << message
end
def output
@output ||= Output.new
end
end
When /^he logs in$/ do
visit("/users/sign_in")
fill_in('Email', :with => @user.email)
fill_in('Password', :with => @user.password)
click_button('Sign in')
end
Then /^he should see "(.*?)"$/ do |message|
@output.messages.should include (message)
end
这是错误消息:
undefined method `[]' for nil:NilClass NoMethodError)
./features/step_definitions/login_steps.rb:6:in `/^he logs in$/'
features/login.feature:5:in `When he logs in'