나는 'The Rspec Book'을 팔로우하고 있는데 오이를 실행할 때 왜 다음 오류가 발생하는지 이해할 수 없습니다.Rspec 오이 : NoMethodError
Feature: code-breaker starts game
As a code-breaker
I want to start a game
So that I can break the code
Scenario: start game # /Users/PC/ruby/practice/rspec/codebreaker/features/codebreaker_starts_game.feature:7
Given I am not yet playing # ruby/practice/rspec/codebreaker/features/step_definitions/codebreaker_steps.rb:17
When I start a new game # ruby/practice/rspec/codebreaker/features/step_definitions/codebreaker_steps.rb:20
Then I should see "Welcome to Codebreaker!" # ruby/practice/rspec/codebreaker/features/step_definitions/codebreaker_steps.rb:25
undefined method `messages' for #<RSpec::Matchers::BuiltIn::Output:0x007fd6611fcb30> (NoMethodError)
./ruby/practice/rspec/codebreaker/features/step_definitions/codebreaker_steps.rb:26:in `/^I should see "(.*?)"$/'
./ruby/practice/rspec/codebreaker/features/codebreaker_starts_game.feature:10:in `Then I should see "Welcome to Codebreaker!"'
And I should see "Enter guess:" # ruby/practice/rspec/codebreaker/features/step_definitions/codebreaker_steps.rb:25
Failing Scenarios:
cucumber /Users/PC/ruby/practice/rspec/codebreaker/features/codebreaker_starts_game.feature:7 # Scenario: start game
1 scenario (1 failed)
4 steps (1 failed, 1 skipped, 2 passed)
0m0.050s
shell returned 1
단계 정의 파일 :
참고 : 나는 인쇄 output.messages을 시도하고 괜찮 았는데.
이것은 http://stackoverflow.com/questions/26850871/newbie-cant-define-a-method-in-ruby-for-cucumber-test-pass의 속일 수 있습니다. – orde