diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-03-19 14:27:01 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-03-19 14:27:01 +0100 |
commit | 9959e9525b9bd3324288c87f1c791cbb488c36c8 (patch) | |
tree | 02d13ea832fbd79f451bb9d24de0ba09e30e8894 /railties/lib/rails/test_unit/minitest_plugin.rb | |
parent | bee9434cdf4f56dc51027a8890cf04f506544735 (diff) | |
parent | d9bbafb2e79bbaee93648b7ee5138a0dbd7e8277 (diff) | |
download | rails-9959e9525b9bd3324288c87f1c791cbb488c36c8.tar.gz rails-9959e9525b9bd3324288c87f1c791cbb488c36c8.tar.bz2 rails-9959e9525b9bd3324288c87f1c791cbb488c36c8.zip |
Merge pull request #19216 from senny/bin_test_runner
`bin/rails test` runner (rerun snippets, run tests by line, option documentation)
Diffstat (limited to 'railties/lib/rails/test_unit/minitest_plugin.rb')
-rw-r--r-- | railties/lib/rails/test_unit/minitest_plugin.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/lib/rails/test_unit/minitest_plugin.rb b/railties/lib/rails/test_unit/minitest_plugin.rb new file mode 100644 index 0000000000..70ce9d3360 --- /dev/null +++ b/railties/lib/rails/test_unit/minitest_plugin.rb @@ -0,0 +1,14 @@ +require "minitest" +require "rails/test_unit/reporter" + +def Minitest.plugin_rails_init(options) + self.reporter << Rails::TestUnitReporter.new(options[:io], options) + if $rails_test_runner && (method = $rails_test_runner.find_method) + options[:filter] = method + end + + if !($rails_test_runner && $rails_test_runner.show_backtrace?) + Minitest.backtrace_filter = Rails.backtrace_cleaner + end +end +Minitest.extensions << 'rails' |