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.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb
index 64e99626eb..bfdc9754d4 100644
--- a/railties/lib/rails/test_unit/reporter.rb
+++ b/railties/lib/rails/test_unit/reporter.rb
@@ -15,8 +15,12 @@ module Rails
filtered_results.reject!(&:skipped?) unless options[:verbose]
filtered_results.map do |result|
location, line = result.method(result.name).source_location
- "bin/rails test #{location}:#{line}"
+ "bin/rails test #{relative_path_for(location)}:#{line}"
end.join "\n"
end
+
+ def relative_path_for(file)
+ file.sub(/^#{Rails.root}\/?/, '')
+ end
end
end