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

David Astels dastels at daveastels.com
Sun May 28 15:39:32 EDT 2006

On 28-May-06, at 1:12 PM, itsme213 wrote:

> However, it is often natural to think of a Context as related to other
> Contexts in a tree structure, where the parent represents some form  
> of a
> pre-requisite context (e.g. when contexts represent states in some  
> state
> sequence, then parent might be an earlier state; or when contexts  
> represent
> an object in an object graph, then parent might be a container  
> object).
> Proposal: Allow contexts to be nested. Setup can either establish the
> context as a side-effect (as it currently does), or return it as an  
> object,
> or both. The block of a nested Context is passed the object  
> returned by the
> parent Context's Setup. The block of each Specify, Setup, and  
> TearDown is
> similarly passed the object returned by the parent Context's Setup.

IMHO this is would be a source of complexity & confusion.

1) The more distributed the context and/or specifications are, the  
more work it is to understand exactly what is going on.

2) Both contexts and specification should be as clear and simple as  


More information about the Rspec-devel mailing list