Daniel Berger wrote:
> Hi all,
> 
> Here are two patches that add startup and shutdown methods to 
> Test::Unit. Unlike setup and teardown, they run once per test suite, not 
> per test.

<snip>

Hm, something's goofy. I just noticed that instance variables aren't 
surviving more than one test. Using the applied patches, I tried this:

require 'test/unit'

class MyTest < Test::Unit::TestCase
    def startup
       @foo = 1
       puts "STARTUP: '#{@foo}'"
    end

    def setup
       puts "SETUP: '#{@foo}'"
    end

    def test_one
       puts "ONE: '#{@foo}'"
       assert_equal(1,1)
    end

    def test_two
       puts "TWO: '#{@foo}'"
       assert_equal(2,2)
    end

    def teardown
       puts "TEARDOWN: '#{@foo}'"
    end

    def shutdown
       puts "SHUTDOWN: '#{@foo}'"
       @foo = nil
    end
end

Here was the result:

STARTUP: '1'
SETUP: '1'
ONE: '1'
TEARDOWN: '1'
.SETUP: '' <- Hey, what happened?
TWO: ''
TEARDOWN: ''
.SHUTDOWN: ''

Have I missed something obvious? Or is Test::Unit mangling it somewhere? 
Works with class variables at least. :)

Regards,

Dan