newbie can't define a method in ruby for cucumber test pass
问题 I am trying to learn cucumber, here's an example code from a book: class Output def messages @messages ||= [] end def puts(message) messages << message end end def output @output ||= Output.new end Given /^I am not yet playing$/ do end When /^I start a new game$/ do game = Codebreaker::Game.new(output) game.start end Then /^I should see "([^"]*)"$/ do |message| output.messages.should include(message) end When I run this spec, I get this error: Scenario: start game # features/codebreaker