From: Tim Pease Date: 2007-02-03T07:40:18+09:00 Subject: Re: Mixing Rake and Turn On 2/2/07, Daniel Berger wrote: > Hi all, > > I've got some test tasks that I've got setup via a Rakefile. I'd like > to see the output in the 'turn' format. However, simply sticking > 'require "turn"' at the top of the Rakefile doesn't quite do the > trick: > > >rake test_foo > Loaded suite /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/ > rake_test_loader > Started > ......................................................................................................................................................................................................................................................... > Finished in 0.440434 seconds. > > 249 tests, 738 assertions, 0 failures, 0 errors > Loaded suite /usr/local/bin/rake > ============================================================================== > pass: 0, fail: 0, error: 0 > total: 0 tests with 0 assertions in 0.001122 seconds > ============================================================================== > > So, it's giving me the nicer summary, but not the line by line result > for each test. > > How do I get Rake to behave the way I want? > When you run your unit tests from within rake, they are actually run in a separate ruby interpreter. Requiring turn into the Rakefile does not require turn into the ruby interpreter where the unit tests are run. You'll have to modify your test task to include turn ... ruby -Ilib -rturn your/test.rb Or use the turn command turn -Ilib your/test.rb The fancy turn summary is coming out of the ruby interpreter running rake. When you require 'turn' the test::unit library is also included. test::unit sets up an empty test suite by default and registers a teardown hook. If no tests are run by the time the interpreter exits, the teardown hook is invoked and the empty test suite is run (hence the empty result set). Hope this explanation helps. Blessings, TwP