Something crazy with rake test


#1

Rake plugin tests are not run anymore (rake 0.8.4 or 0.8.3) !

rails foo
cd foo
script/generate plugin bar
cd vendor/plugins/bar
rake test

No test is run, no output of the usual number of assertions, number of
tests…

rake output is
(in /usr/local/www/foo/vendor/plugins/bar)
/usr/bin/ruby -I"/usr/local/www/foo/vendor/plugins/bar/lib"
-I"/usr/local/www/foo/vendor/plugins/bar/lib"
-I"/usr/local/www/foo/vendor/plugins/bar/test"
“/usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb”
“test/bar_test.rb”

editing test_bar.rb and modifying the default “truth” assertion with
assert false does not produces any assertion failure since the tests are
not run at all

It worked yesterday and I only upgraded to rake 0.8.4 then reverted to
0.8.3

Any idea ?


#2

This is a bug.

Described here
http://rails.lighthouseapp.com/projects/8994/tickets/1878-a-generated-plugins-tests-are-not-run-by-rake-test

The generated test_helper.rb file is faulty

Solution is to
require ‘test/unit’ at the top of test_helper.rb