aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-03-22 21:17:45 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-03-22 21:35:32 +0100
commitb9465e8755509cc79ad7492914a26c8ac3884de0 (patch)
treeb4a048c457daec8f44478917563e633a2d33da80 /railties
parentb9a21f08563b7d4b77f4c48b73acd877178d55c3 (diff)
downloadrails-b9465e8755509cc79ad7492914a26c8ac3884de0.tar.gz
rails-b9465e8755509cc79ad7492914a26c8ac3884de0.tar.bz2
rails-b9465e8755509cc79ad7492914a26c8ac3884de0.zip
Set Rails as the first minitest initialized plugin.
When calling `load_plugins` minitest would fill out its extensions, then we'd tackle ourselves on as the last plugin. Because minitest loads plugins in order we will ultimately have the last say on what reporters will be used. Invert that strategy by putting ourselves first and give other plugins plenty of leeway to override our default reporter setup. Fixes #24179.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/test_unit/minitest_plugin.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/test_unit/minitest_plugin.rb b/railties/lib/rails/test_unit/minitest_plugin.rb
index f22139490b..e1ba501a47 100644
--- a/railties/lib/rails/test_unit/minitest_plugin.rb
+++ b/railties/lib/rails/test_unit/minitest_plugin.rb
@@ -93,5 +93,7 @@ module Minitest
mattr_accessor(:run_with_rails_extension) { false }
end
+# Let libraries override our reporter setup by loading other plugins then
+# setting ourselves as the first plugin to be initialized.
Minitest.load_plugins
-Minitest.extensions << 'rails'
+Minitest.extensions.unshift 'rails'