diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 85dd8552b..1a83c30ec 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -118,7 +118,14 @@ def define elsif !ok status = "Command failed with status (#{status.exitstatus})" details = ": [ruby #{args}]" - fail (ARGV.include?('--trace') || @verbose) ? (status + details) : status + message = + if Rake.application.options.trace or @verbose then + status + details + else + status + end + + fail message end end end