[Rspec-devel] Nested contexts

David Chelimsky dchelimsky at gmail.com
Fri Jun 9 22:01:01 EDT 2006


On 6/9/06, Evgeny <evgeny.zislis at gmail.com> wrote:
> Actually the subject sais it all, but i'll repeat "Nested contexts".
> AFAIK it does not exist in the current version, and in the democratic
> spirit of this list I would like to ask for a poll.
>
> All in favor : +1
> All against : -1
>
>
> Regards,
>
> Evgeny
>
>
> PS: Okay okay, for those who dont understand what I'm talking about
> I'll give a short example.
>
> context "This is the first context"
>    setup
>      # some things to do for the first context
>    end
>
>    context "this is actually a subcontext for the first one"
>       setup
>          # things that will only be setup in this subcontext
>       end
>    end
>    context "this is the second subcontext"
>       setup
>          # this has a different setup, but its also empty....
>       end
>    end
> end

-1 for the time being

One of the reasons BDD exists is because people doing TDD have been
writing test structures that are very difficult to understand and
therefore less valuable. Structures like nested contexts are going to
lead to degredation in clarity, and we have to weigh the costs of some
duplication against the costs of unclear specs.

I do think that we'll have to address the duplication issue at one
point, but I also think we need more time to evaluate the REAL effects
of different types of duplication in specs, in the context of BDD,
before we introduce new constructs into rspec.

That's my 2 cents.

But, admittedly, just one vote :)


More information about the Rspec-devel mailing list