[rspec-users] shared behav

David Chelimsky dchelimsky at gmail.com
Tue Dec 18 17:48:20 EST 2007


On Dec 18, 2007 4:46 PM, Rick DeNatale <rick.denatale at gmail.com> wrote:
> On 12/18/07, David Chelimsky <dchelimsky at gmail.com> wrote:
>
> > That's actually as it should be. The common use case for nested is
> > that you create something in the outer group and expand its definition
> > in the inner group.
> >
> > describe Thing do
> >   before(:each) { @thing = Thing.new }
> >
> >   describe "with special magic powers" do
> >     before(:each) { @thing.grant_special_magic_powers }
> >     it "should be able to conjure up world peace" do
> >       @thing.should be_able_to_conjure_up_world_peace
> >     end
> >   end
> > end
> >
> > This requires running the befores in the outer groups first, which is
> > the opposite of what your example would require.
> >
> > Make sense?
>
> Yes and it helps clarify my questions about how nested groups were
> different, if at all, from shared groups.

My response to scott's mail should enlighten that a bit as well.

Nested groups are subclasses of the outer groups.

Shared groups get mixed in.

>
>
> --
> Rick DeNatale
>
> My blog on Ruby
> http://talklikeaduck.denhaven2.com/
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list