diff options
author | Arthur Neves <arthurnn@gmail.com> | 2015-01-23 22:57:52 -0500 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-03-18 09:52:17 +0100 |
commit | ccee7eea8e5a8a34256467dd1096ac549dd17362 (patch) | |
tree | 2f6810e0624303bbce3e245297378ae62e569806 /railties/lib/rails/test_unit | |
parent | a71bcdb4f3ab25594955277fa7a7c49c84cd0925 (diff) | |
download | rails-ccee7eea8e5a8a34256467dd1096ac549dd17362.tar.gz rails-ccee7eea8e5a8a34256467dd1096ac549dd17362.tar.bz2 rails-ccee7eea8e5a8a34256467dd1096ac549dd17362.zip |
Show the right file when test raises
Diffstat (limited to 'railties/lib/rails/test_unit')
-rw-r--r-- | railties/lib/rails/test_unit/reporter.rb | 7 |
1 files changed, 3 insertions, 4 deletions
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 |