On Tue, 16 May 2006, Sy Ali wrote:

> On 5/14/06, ara.t.howard / noaa.gov <ara.t.howard / noaa.gov> wrote:
>> well, if you have non-test code you can do whatever you like to order it
>
> Not really.  All the testing code will be run after other code,
> nomatter what you do.. even using begin/end blocks wouldn't work for
> me.  All tests would run afterwards.  It was quite wierd.  Only the
> testrunner stuff ended up working.

can you show us this?  it works for me:

   harp:~ > cat a.rb
   BEGIN{ puts '======== BEGIN ========' }

   END{ puts '======== END ========' }

   require 'test/unit'

   class ATest < Test::Unit::TestCase
     def test_a() assert true end
   end


   harp:~ > ruby a.rb
   ======== BEGIN ========
   Loaded suite a
   Started
   .
   Finished in 0.000684 seconds.

   1 tests, 1 assertions, 0 failures, 0 errors
   ======== END ========


>> On Mon, 15 May 2006, Sy Ali wrote:
>> > As I understand, tests are not guaranteed to run in any order and while 
>> this
>> > feature may work right now.. it may be removed in the future.
>> 
>> where did you hear it might be removed in the future?
>
> I wish I had a source for this, but I don't.  I'm just told it by
> people who know better than me.  =)

hmm. well the link i sent, although a bit old, was from the test/unit
maintainer, so i think that's probably right for now.

cheers.

-a
-- 
be kind whenever possible... it is always possible.
- h.h. the 14th dali lama