From: Ryan Leavengood Date: 2007-04-03T23:44:06+09:00 Subject: Re: Test::Unit running all tests with automated suite On 4/2/07, Brett Schuchert wrote: > > So two questions: > > 1. Is the necessary or what am I missing (I've just started using Ruby a > few days ago). > 2. I assume someone can suggest to me ways to shorten this up. I'm all > ears. To answer both questions: require 'test/unit' require 'test/unit/collector/dir' Test::Unit::Collector::Dir.new.collect By default this recursively collects and runs all test case classes in the current directory in files that match the pattern test_*.rb. It is very customizable though. For example to examine all .rb files for tests: dc = Test::Unit::Collector::Dir.new dc.pattern << /\b.*\.rb\Z/m dc.collect Someone really needs to properly document all the cool stuff included with Test::Unit. That someone may be me eventually :) Ryan