diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 4fb871e46..85dd8552b 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -116,8 +116,9 @@ 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}]" + fail (ARGV.include?('--trace') || @verbose) ? (status + details) : status end end end