From: "Gerrit L." Date: 2012-08-13T00:55:23+09:00 Subject: Re: Using Test::Unit::Testcase for multiple execution Thanks Brian! Answer 2. seems to do the job for me, because I can separate the (ten) calls from the testcases/testsuite. And I will try it out! Bye Gerrit Brian Candler wrote in post #1072073: > Gerrit Leder wrote in post #1071964: >> ... > > 2. Call the test runner ten times > > To do this, don't rely on the default behaviour. That is: when you > require 'test/unit', it finds all class objects derived from > Test::Unit::TestCase and runs them once. > > Notice the following code at the end of test/unit.rb (this may be > installed somewhere like /usr/lib/ruby/1.8/test/unit.rb) > > at_exit do > unless $! || Test::Unit.run? > Kernel.exit Test::Unit::AutoRunner.run > end > end > > So now you can see how it works, you can run the test suite 10 times: > > ----8<---- > require 'test/unit/testcase' > require 'test/unit/autorunner' > > class TestFoo < Test::Unit::TestCase > def test_foo > assert true > end > end > > 10.times { Test::Unit::AutoRunner.run } > ----8<---- > > HTH, > > Brian. -- Posted via http://www.ruby-forum.com/.