I''ve been doing some really simple rails testing, going along with
standard "red light... green light..." back-and-forth-ing.
All of a sudden, rake was reporting that there were "Test failures"
but
not showing any stack trace. I went into
/usr/local/ruby/.../rails/lib/tasks/testing.rake
and looked at the source that ran the tests.
I found these lines:
---
desc ''Test all units and functionals''
task :test do
Rake::Task["test:units"].invoke rescue got_error = true; puts
''Unit test error: '' + $!.inspect
Rake::Task["test:functionals"].invoke rescue got_error = true; puts
''Functional test error: '' + $!.inspect
if File.exist?("test/integration")
Rake::Task["test:integration"].invoke rescue got_error = true;
puts
''Integration test error: '' + $!.inspect
end
raise "Test failures" if got_error
end
---
The extra statements in the rescue blocks are my own. That is, I added
; puts ''Unit test...
Running rake again, I now get
''Unit test error: nil''
/usr/local/bin/ruby -Ilib:test
"/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb"
Functional test error: nil
/usr/local/bin/ruby -Ilib:test
"/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb"
Integration test error: nil
rake aborted!
Test failures
Can anybody help me diagnose why these tests are failing? I can tell
you that I''m definitely not even getting into any of the test case
bodies, since they have print statements that aren''t getting executed.
Thanks,
gcn
--
Posted via http://www.ruby-forum.com/.