From ccee7eea8e5a8a34256467dd1096ac549dd17362 Mon Sep 17 00:00:00 2001 From: Arthur Neves Date: Fri, 23 Jan 2015 22:57:52 -0500 Subject: Show the right file when test raises --- railties/lib/rails/test_unit/reporter.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb index 6d33fae911..e82c4e653c 100644 --- a/railties/lib/rails/test_unit/reporter.rb +++ b/railties/lib/rails/test_unit/reporter.rb @@ -14,10 +14,9 @@ module Rails filtered_results = results.dup filtered_results.reject!(&:skipped?) unless options[:verbose] filtered_results.map do |result| - result.failures.map { |failure| - "bin/rails test #{failure.location}\n" - }.join "\n" - end.join + location, line = result.method(result.name).source_location + "bin/rails test #{location}:#{line}" + end.join "\n" end end end -- cgit v1.2.3