The book shows:
"Then /^I should see "([^"]*)"$/ do |message|
output.messages.should include(message)
end"
Excerpt From: David Chelimsky. "The RSpec Book (for Tamara Temple)." iBooks.
you have |arg1| after the do, not |message|
On Sun, Apr 6, 2014 at 3:16 AM, ruby rails <lists@ruby-forum.com> wrote:
> I am trying to learn Rspec-Cucumber tutorial by referring to "The
> Pragmatic Programmers - The Rspec Book". I am on the 4th chapter and
> seems to be stuck with an error and not able to move forward.I have
> followed exactly as per the tutorial but it is showing the below error
> `( in line : output.messages.should include(message))`when I try to run
> cucumber feature in my console.
>
> **undefined local variable or method `message' for #<Object:0x9c0c05c>
> (NameError)**
>
> My codebreaker_steps.rb file is as follows.
>
> Then /^I should see "([^"]*)"$/ do |arg1|
> output.messages.should include(message)
> end
>
> class Output
> def messages
> @messages ||= []
> end
>
> def puts(message)
> messages << message
> end
> end
>
> def output
> @output ||= Output.new
> end
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cdd22ee1da1a032980ebe9228afc28f0%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t_oS%3DBYuB8g1bWQRBvf_Y9AP557AQ71zMPYUBHz_3jXpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment