From: Simon Strandgaard Date: 2003-12-02T05:22:14+09:00 Subject: Re: how do I create a TestSuite On Tue, 02 Dec 2003 02:34:02 +0900, Rasputin wrote: > * Nathaniel Talbott [1210 17:10]: >> On Dec 1, 2003, at 10:26, Rasputin wrote: >> >> >This code used to work under 1.6.8 with Test::Unit 0.1.8: [snip] >> >class Daddy < Test::Unit::TestSuite >> > self << ChainTest.new >> > self << ChunkerTest.new >> > self << FilestoreTest.new >> self << ChainTest.suite >> self << ChunkerTest.suite >> self << FilestoreTest.suite >> >end How about a 'test_all.rb' which simply just appends all testsuites it finds in current dir ? server> expand -t2 test_all.rb require 'test/unit' class TestAll def TestAll.suite suite = Test::Unit::TestSuite.new Object.constants.sort.each do |k| next if /^Test/ !~ k constant = Object.const_get(k) if constant.kind_of?(Class) && constant.superclass == Test::Unit::TestCase suite << constant.suite end end suite end end if __FILE__ == $0 Dir.glob("test_*.rb").each do |file| require "#{file}" end require 'test/unit/ui/console/testrunner' Test::Unit::UI::Console::TestRunner.run(TestAll) end server> -- Simon Strandgaard