aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/test_unit/reporter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/test_unit/reporter.rb')
-rw-r--r--railties/lib/rails/test_unit/reporter.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb
index 73b8d7d27b..ce99dbd585 100644
--- a/railties/lib/rails/test_unit/reporter.rb
+++ b/railties/lib/rails/test_unit/reporter.rb
@@ -68,19 +68,13 @@ module Rails
def format_failures(result)
result.failures.map do |failure|
- "#{failure.result_label}:\n#{result.class}##{result.name}:\n#{failure.message}\n"
+ "#{failure.result_label}:\n#{result.location}:\n#{failure.message}\n"
end
end
def format_rerun_snippet(result)
- # Try to extract path to assertion from backtrace.
- if result.location =~ /\[(.*)\]\z/
- assertion_path = $1
- else
- assertion_path = result.method(result.name).source_location.join(':')
- end
-
- "#{self.executable} #{relative_path_for(assertion_path)}"
+ location, line = result.method(result.name).source_location
+ "#{self.executable} #{relative_path_for(location)}:#{line}"
end
def app_root