get instance variable @output, and when its nil assigns an object Output.new
On 05.11.2012, at 18:49, roelof <[email protected]> wrote:

> 
> 
> Op maandag 5 november 2012 15:34:05 UTC+1 schreef addagger het volgende:
> when you call @output.messages.should include (message)
> @output is nil
> 
> call (@output ||= Output.new).messages.should include (message)
> 
> That worked but can you explain what this does ?
> 
> Roelof
>  
> 
> 
> On 05.11.2012, at 10:40, roelof <[email protected]> wrote:
> 
>> Hello,
>>  
>> Im initializing that file here :
>>  
>> def output
>> @output ||= Output.new
>> end
>> 
>> in the class Output.
>>  
>> Roelof
>> 
>> Op maandag 5 november 2012 00:52:22 UTC+1 schreef Matt Jones het volgende:
>> 
>> 
>> On Saturday, 3 November 2012 16:43:19 UTC-4, roelof wrote:
>> Hello, 
>> 
>> I have my source here : https://github.com/roelof1967/tamara
>> 
>> When I do cucumber I get this error message :
>> Then he should see "Welcome, Aslak"         # 
>> features/step_definitions/login_steps.rb:27
>>       undefined method `messages' for nil:NilClass (NoMethodError)
>>       ./features/step_definitions/login_steps.rb:28:in `/^he should see 
>> "(.*?)"$/'
>>       features/login.feature:6:in `Then he should see "Welcome, Aslak"'
>> 
>> Which I find wierd because I have a method messages made in my class Output.
>> 
>> 
>> I don't see where you're initializing @output anywhere in that file - it's 
>> going to be hard to call methods on an uninitialized instance variable...
>> 
>> --Matt Jones 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to 
>> [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/rubyonrails-talk/-/A0gcSBsTn0sJ.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/rubyonrails-talk/-/_OozA0jfEqIJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to