From: Stefano Taschini Date: 2006-05-03T08:16:25+09:00 Subject: Re: Unit test setup Actually, a test case object is created for each test_something method (see test/unit/testcase.rb:51 in ruby 8.4). This means that overriding the initializer does not bring anything more than overriding setup. In fact, it makes things worse, as exceptions in setup and teardown are caught by the Test::Unit framework (and hence correctly reported), whereas those in the test case initializer are not. Ciao Stefano On 02/05/06, John Wilger wrote: [...] > Only half correct. You can override the #initialize method in the test case: > > class TestTheTestsTest < Test::Unit::TestCase > def initialize( *args ) > super > @foo = :bar > end > > def test_initialize > assert_equal :bar, @foo > end > end [...]