Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading message and test results appears after running rake task in Rails application

The following output appears after running some rake tasks:

Loaded suite /usr/bin/rake
Started

Finished in 0.00042 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

This output is not useful or necessary for tasks not related to testing. I'd like to prevent it from appearing. I would assume it stems from requiring a certain file or including a certain module.

Updated: It appears that I was wrong and this does come up during some of the tasks built into Rails. Here is the output of fixtures being loaded with --trace.

$ rake db:fixtures:load --trace

** Invoke db:fixtures:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:fixtures:load
Loaded suite /usr/bin/rake
Started

Finished in 0.000255 seconds.

0 tests, 0 assertions, 0 failures, 0 errors
like image 842
Jared Avatar asked Oct 12 '09 17:10

Jared


2 Answers

Solution can be found here:

http://github.com/thoughtbot/shoulda/issues/#issue/59

Basically don't require the shoulda gem unless it's the test environment (where test/unit would already be required).

like image 130
fowlduck Avatar answered Oct 18 '22 01:10

fowlduck


First check the test pattern for your Rake::TestTask. Should be something like 'test/**/*_test.rb'.

For whatever reason, Test::Unit is trying to find tests in the /usr/bin/rake executable, which probably means you've got a bogus pattern somewhere.

Anytime you have problems like this, you want to run rake with --trace to see what tasks and task dependencies are being run, and in which order. If updating the pattern doesn't work, please copy the output of a full run with --trace switched on into your question.

like image 39
Bob Aman Avatar answered Oct 18 '22 00:10

Bob Aman