From: Christian Neukirchen Date: 2005-09-04T18:57:13+09:00 Subject: Re: Idea about Test::Unit "Trans" writes: > I've gotten tired of this verbosity myself and have started playing > with: > > require 'quicktest' > > test :foo { > ... > } Truly amazing, I wrote *exactly* the same thing for myself. Except mine is called "quiktest" and the test name is optional (you need to use parens or do...end in above, btw). :-P require 'test/unit' $TGEN = "000000" def test(name=nil, &block) @@test ||= Class.new(Test::Unit::TestCase) @@test.__send__(:define_method, "test_#{name.to_s || $TGEN.succ!}", &block) end Test::Unit.run = !$DEBUG > T. -- Christian Neukirchen http://chneukirchen.org