1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use on_load to trigger commandline processing code

We need to use on_load so that plugins will get the same functionality
This commit is contained in:
Aaron Patterson 2016-10-21 14:44:17 -07:00
parent 797f1dd63c
commit b6f935bbf9
No known key found for this signature in database
GPG key ID: 953170BCB4FFAFC6
3 changed files with 10 additions and 5 deletions

View file

@ -65,5 +65,7 @@ module ActiveSupport
alias :assert_not_predicate :refute_predicate
alias :assert_not_respond_to :refute_respond_to
alias :assert_not_same :refute_same
ActiveSupport.run_load_hooks(:active_support_test_case, self)
end
end

View file

@ -1,6 +1,5 @@
require "rails/command"
require "rails/test_unit/minitest_plugin"
require "rails/test_unit/line_filtering"
module Rails
module Command
@ -12,10 +11,6 @@ module Rails
def perform(*)
$LOAD_PATH << Rails::Command.root.join("test")
# Add test line filtering support for running test by line number
# via the command line.
ActiveSupport::TestCase.extend Rails::LineFiltering
Minitest.run_via[:rails] = true
require "active_support/testing/autorun"

View file

@ -1,3 +1,5 @@
require "rails/test_unit/line_filtering"
if defined?(Rake.application) && Rake.application.top_level_tasks.grep(/^(default$|test(:|$))/).any?
ENV["RAILS_ENV"] ||= "test"
end
@ -11,6 +13,12 @@ module Rails
c.integration_tool :test_unit
end
initializer "test_unit.line_filtering" do
ActiveSupport.on_load(:active_support_test_case) {
ActiveSupport::TestCase.extend Rails::LineFiltering
}
end
rake_tasks do
load "rails/test_unit/testing.rake"
end