diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 4fb871e46..1a83c30ec 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -116,8 +116,16 @@ def define if !ok && status.respond_to?(:signaled?) && status.signaled? raise SignalException.new(status.termsig) elsif !ok - fail "Command failed with status (#{status.exitstatus}): " + - "[ruby #{args}]" + status = "Command failed with status (#{status.exitstatus})" + details = ": [ruby #{args}]" + message = + if Rake.application.options.trace or @verbose then + status + details + else + status + end + + fail message end end end