[Rspec-devel] context could yield an object, and be nested

itsme213 itsme213 at hotmail.com
Mon May 29 11:50:55 EDT 2006


From: "David Astels" <dastels at daveastels.com>
>> In an empty home
>>   - the security system should be enabled
>
>> When a the system is triggered
>>   - the system should beep
>>   - the display should highlight the door
>
>> When the password is entered on time after the system is triggered
>>   - the beeping should stop
>>   - the system should be disabled
>>   - the display should highlight the door
>
>> When the password is not entered on time after the system is triggered
>>   - the alarm should go off
>>   - the monitoring company should be notified

Hmm. If I understand your reasoning, then why not go the logical next step 
and do further un-distribute as follows:

------------
When the password is entered on time after the system is triggered the 
beeping should stop

When the password is entered on time after the system is triggered the 
system should be disabled

When the password is entered on time after the system is triggered the 
display should highlight the door
------------

It seems to me that nested contexts and r-spec's context-specification 
separation are both doing very similar "distribution". Btw, I am just trying 
to understand your reasoning here.

Thanks.


More information about the Rspec-devel mailing list