From: Brian Candler Date: 2009-03-24T07:02:17+09:00 Subject: Re: Test::Unit - same test, different "args" 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 See: http://www.thoughtbot.com/projects/shoulda http://mtnwestrubyconf2008.confreaks.com/12saleh.html http://tammersaleh.com/system/assets/bdd_with_shoulda.pdf -- Posted via http://www.ruby-forum.com/.