diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-06-13 11:56:32 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-06-13 11:58:43 +0200 |
commit | 2e5960490936890624cdb2e23c9da4f2b12c4fbf (patch) | |
tree | 339c043703c0ddce24136174d7cebeb8ad0caa63 /railties/lib/rails/test_unit | |
parent | c0b4654dbafd662a9967432e188970d404ab381d (diff) | |
download | rails-2e5960490936890624cdb2e23c9da4f2b12c4fbf.tar.gz rails-2e5960490936890624cdb2e23c9da4f2b12c4fbf.tar.bz2 rails-2e5960490936890624cdb2e23c9da4f2b12c4fbf.zip |
make it possible to customize the executable inside rereun snippets.
In the Rails repository we use a `bin/test` executable to run our tests.
However the rerun snippets still included `bin/rails test`:
BEFORE:
```
Failed tests:
bin/rails test test/cases/adapters/postgresql/schema_test.rb:91
```
AFTER:
```
Failed tests:
bin/test test/cases/adapters/postgresql/schema_test.rb:91
```
Diffstat (limited to 'railties/lib/rails/test_unit')
-rw-r--r-- | railties/lib/rails/test_unit/reporter.rb | 6 |
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 bfdc9754d4..faf551f381 100644 --- a/railties/lib/rails/test_unit/reporter.rb +++ b/railties/lib/rails/test_unit/reporter.rb @@ -1,7 +1,11 @@ +require "active_support/core_ext/class/attribute" require "minitest" module Rails class TestUnitReporter < Minitest::StatisticsReporter + class_attribute :executable + self.executable = "bin/rails test" + def report return if results.empty? io.puts @@ -15,7 +19,7 @@ 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 #{relative_path_for(location)}:#{line}" + "#{self.executable} #{relative_path_for(location)}:#{line}" end.join "\n" end |