From: Rasputin Date: 2003-12-02T18:54:33+09:00 Subject: Re: how do I create a TestSuite * Simon Strandgaard [1223 20:23]: > > How about a 'test_all.rb' which simply just appends all testsuites it > finds in current dir ? Sweet! Thanks a lot! > 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 > -- All my friends and I are crazy. That's the only thing that keeps us sane. Rasputin :: Jack of All Trades - Master of Nuns