Forum: Ruby on Rails 'rake test' abends with just Test failures - real error thro

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2007-03-18 04:29
(Received via mailing list)

The Rails test engine contains otherwise flawless error handling. So,
being bedeviled by intermittent "Test failure" abnormal test
terminations, I
finally got around to --trace-ing the problem, and when I found it the
clumsiness surprised me:

desc 'Test all units and functionals'
task :test do
  Rake::Task["test:units"].invoke       rescue got_error = true
  Rake::Task["test:functionals"].invoke rescue got_error = true

  if File.exist?("test/integration")
    Rake::Task["test:integration"].invoke rescue got_error = true

  raise "Test failures" if got_error

What that means is, if any test_ case fails, we see a healthy error
but if the test rig itself fails, 'rescue got_error = true' will throw
the e.message and e.backtrace, and the raise "Test failures" will
provide an
irrelevant error message and backtrace.

I'm going to copy this task :test into my lib/tasks/project.rake file,
replace the error hiding with a real error handling block. Further, if
test rig itself has failed, I don't care to keep running any more tests,
I won't bother with the system that tolerates their faults.

Why was this method so clumsy, and hasn't anyone asked for an upgrade on

  Phlip <-- NOT a blog!!!
54d80d7f453dbeb62be9604bda054788?d=identicon&s=25 dysinger (Guest)
on 2007-03-18 06:21
(Received via mailing list)
this has been fixed in rails 1.2.3 -Tim
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2007-03-18 06:40
(Received via mailing list)
dysinger wrote:

> this has been fixed in rails 1.2.3 -Tim


And to think that just this morning I ran 'gem install -v=1.2.2
rails --include-dependencies', just to sync all my versions on all my
computers... ;-)

  Phlip <-- NOT a blog!!!
This topic is locked and can not be replied to.