From: Ian Macdonald Date: 2004-02-04T19:40:42+09:00 Subject: Re: overriding setup in Test::Unit On Wed 04 Feb 2004 at 18:21:33 +0900, nobu.nokada@softhome.net wrote: > Seems fine. > > $ cat test.rb > class TC_Foo < Test::Unit::TestCase > def setup > puts "Foo#setup" > end > > def test_method1 > assert_nothing_raised {puts "Foo#test_method1"} > end > > def test_method2 > assert_nothing_raised {puts "Foo#test_method2"} > end > end > > class TC_Goo < TC_Foo > def setup > puts "Goo#setup" > end > > def test_method1 > assert_nothing_raised {puts "Goo#test_method1"} > end > > # TC_foo#method2 will get called for > > end > $ testrb -vs test.rb > Foo#setup > Foo#test_method1 > Foo#setup > Foo#test_method2 > Goo#setup > Goo#test_method1 > Goo#setup > Foo#test_method2 The real code is more complex, of course. A lot of files are being 'require'd and there are modules being mixed in, too, so I think I'm experiencing some weird interaction there. Thanks for your help. Ian -- Ian Macdonald | The only cultural advantage LA has over NY System Administrator | is that you can make a right turn on a red ian@caliban.org | light. -- Woody Allen http://www.caliban.org | |