[rspec-users] Story Runner: Finally understand when steps are reusable.

Andy Watts andywatts at yahoo.com
Mon Oct 15 21:50:21 EDT 2007


Thanks David,

After rereading Dan's original rbehave introduction, i see its important to
think of steps are either
1. Givens 
2. Events (When)
3. Outcomes (Then)

In a 'Then..And' scenario, the 'And' is an Outcome and therefore reusable
only as an outcome.
That is, either 'Then' or a in another 'Then..And'.

Similarly, in a 'When..And' scenario, this 'And' is an Event step and is
reusable as a 'When' or in another 'When..And'.

- Andy




David Chelimsky-2 wrote:
> 
> On 10/15/07, Andy Watts <andywatts at yahoo.com> wrote:
>>
>> Maybe I'm slow, but I just noticed that the following code..
>>
>> When 'I login'
>> When 'I do something else'
> 
> You're encouraged to write this as:
> 
> When 'I login'
> And 'I do something else'
> 
> Cheers,
> David
> 
>>
>> ...will output as...
>>
>> When 'I login'
>> And 'I do something else'
>>
>> The same is true for two 'Then' steps
>>
>> That is really cool!
>> Reusable steps and coherent English output.
>>
>> - Andy
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Story-Runner%3A-Two-%27then%27-steps-output-as-%27then..and%27-%3A%29-tf4625856.html#a13209643
>> Sent from the rspec-users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Re%3A-Story-Runner%3A-Two-%27then%27-steps-output-as-%27then..and%27-%3A%29-tf4626482.html#a13225454
Sent from the rspec-users mailing list archive at Nabble.com.



More information about the rspec-users mailing list