From b6fc8e25a10cc4abdd03018798b180270d6c5d7f Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sat, 21 Mar 2015 13:15:56 +0100 Subject: Improve test runner's Minitest integration. This also adds free mix and matching of directories, files and lines filters. Like so: bin/rails test models/post_test.rb test/integration models/person_test.rb:26 You can also mix in a traditional Minitest filter: bin/rails test test/integration -n /check_it_out/ --- railties/lib/rails/test_unit/reporter.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails/test_unit/reporter.rb') 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 -- cgit v1.2.3