From: Timothy Hunter Date: 2006-05-14T07:39:35+09:00 Subject: Re: Forcing some code to run at the end of tests On May 13, 2006, at 6:27 PM, Sy Ali wrote: > On 5/13/06, Mike Stok wrote: >> >> On 13-May-06, at 5:44 PM, Sy Ali wrote: >> >> > I'm playing with some test scripts, and I cannot for the life of me >> > ensure that a block of code is run after every test is run. I can >> > think of some ugly ways to do it.. but is there an elegant way >> which I >> > missed? >> >> Does every test mean every test case? If so you might look at >> Test::Unit::TestCase's teardown. > > No, not teardown.. I want to have some code executed after all testing > has concluded. > > You'd think it'd be a matter of running it all at the end of the .rb > file, but this is not true.. everything is run and _then_ the test > cases are run. > > I suppose I could wrap the entire test in another ruby file.. it just > seems strange to need to do this. Use an END block.