From: pat eyler Date: 2006-03-10T02:35:20+09:00 Subject: Re: Test Harness? or, use Rake and a task like: Rake::TestTask.new(:unittests) do |t| t.test_files = FileList['test/test*.rb'] t.warning = true t.verbose = false end then when you want to run your tests do: $ rake unittests (in /home/eylerpm/notes/ruby/provisioning) Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader Started ................. Finished in 2.307442 seconds. 17 tests, 55 assertions, 0 failures, 0 errors $ On 3/9/06, Alex Combas wrote: > perhaps this will also help > http://www.zenspider.com/ZSS/Products/ZenTest/ > > On 3/9/06, James Edward Gray II wrote: > > On Mar 9, 2006, at 10:56 AM, Troy Denkinger wrote: > > > > > I'm starting to feel my way around in Ruby after having been a > > > Perler for a > > > very long time. I'm trying to figure out how to write a proper > > > test harness > > > in Ruby and so far I'm running up against a brick wall. All my > > > classes have > > > good unit tests using Test::Unit. However, I want to create a > > > harness that > > > I can use to run all of the unit tests at a go and give me a > > > success/failure > > > report across all tests. Every time I make a significant change I > > > have to > > > remember to run all my unit tests, which is error prone. > > > > > > I have written test harnesses in Perl using Test::Harness::Straps > > > that does > > > exactly what I want - for Perl. Is there a similar library for > > > Ruby? If > > > so, I have yet to find it. > > > > Making a test suite is trivial. Just add a final like "ts_all.rb" to > > your test folder that looks something like this: > > > > #!/usr/local/bin/ruby -w > > > > require "test/unit" > > > > require "tc_file_one.rb" > > require "tc_file_two.rb" > > # ... > > > > __END__ > > > > Execute that file to run all of the tests. Hope that helps. > > > > James Edward Gray II > > > > > > > -- > Alex Combas > http://noodlejunkie.blogspot.com/ > -- thanks, -pate -------------------------