From: "Luke St.Clair" Date: 2009-03-25T04:51:52+09:00 Subject: Re: Test::Unit - same test, different "args" On Mar 23, 3:02 pm, Brian Candler wrote: > Luke St.Clair wrote: > > Is there some way to: > > 1) set a global variable in the "parent" test suite that the children > > see?  Seems like the answer to this is no > > Shoulda sits on top of Test::Unit and may be helpful. Something like > this: > > class MyTest < Test::Unit::TestCase >   context "top level" do >     setup do >       @stuff = ... >     end > >     should "test something at top level" do >       assert_equal 123, @stuff.size >     end > >     context "inner level" do >       setup do >         @more_stuff = ... >       end > >       should "test more" do >         assert_equal @stuff.size, @more_stuff.size >       end >     end >   end > end This seems incredibly useful - unfortunately, I can't use shoulda.