From: kelly Date: 2007-02-15T02:41:21+09:00 Subject: Re: what runs when running tests? Lyle, Thanks very much. I see the code you refer to. Now I wonder why it is done using the at_exit method -- seems a little obtuse to me. My original question has been answered. Thanks again. -Kelly On Feb 14, 9:22 am, "Lyle Johnson" wrote: > On 2/14/07, kelly wrote: > > > I scanned Test::Unit::TestCase and I see a bunch of function > > definitions, but I don't see what runs. I guess I'm looking for a > > method or piece of code that starts running, initializes things, finds > > the test_* test methods and starts running them. > > To expand on Austin's answer just a little: I think the magic that > you're looking for is at the tail end of unit.rb, in the > lib/1.8/test/unit directory of the standard library. Test::Unit takes > advantage of the at_exit() method to register a little bit of code > that invokes the Test::Unit AutoRunner class right before the > interpreter exits.