From: Daniel Nugent Date: 2006-03-10T08:29:00+09:00 Subject: Re: Test Harness? Is there a way to pass Rake tasks arguments? I'd like to do something where I break my unit tests up into test suites by just dropping them into folders and then being able to invoke a Rake task like rake suite "sweet" or rake suite "sweet/saccharine", if I wanted a test suite inside of a test suite. Or, alternatively, I'd like to be able to invoke test cases named "sucrose" by rake test_case "sucrose" Disclaimer: I've read Rake tutorials several times in the past but have yet to arse myself to start using it (which I should, because I think I'm starting to exert more effor than is worthwhile keeping tests organzied without rake), so I might've forgotten the part where it says you can do exactly what I'm asking. On 3/9/06, Ross Bamford wrote: > On Fri, 2006-03-10 at 01:56 +0900, 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 see you've had plenty of suggestions, but heres yet another variation: > > $ ruby -e "Dir['test/tc*.rb'].each { |tc| require tc }" > Loaded suite -e > Started > ....................................... > Finished in 0.25893 seconds. > > 39 tests, 101 assertions, 0 failures, 0 errors > > That 'Loaded suite -e' thing is a shame though... > > -- > Ross Bamford - rosco@roscopeco.REMOVE.co.uk > > > -- -Dan Nugent