diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb index dcf28e4d14..f36685da4b 100644 --- a/railties/lib/rails/test_unit/reporter.rb +++ b/railties/lib/rails/test_unit/reporter.rb @@ -5,6 +5,7 @@ require "minitest" module Rails class TestUnitReporter < Minitest::StatisticsReporter + class_attribute :app_root class_attribute :executable, default: "rails test" def record(result) @@ -79,11 +80,9 @@ module Rails end def app_root - @app_root ||= + @app_root ||= self.class.app_root || if defined?(ENGINE_ROOT) ENGINE_ROOT - elsif defined?(COMPONENT_ROOT) - COMPONENT_ROOT elsif Rails.respond_to?(:root) Rails.root end diff --git a/tools/test.rb b/tools/test.rb index 19bd980723..b40b83e52a 100644 --- a/tools/test.rb +++ b/tools/test.rb @@ -12,6 +12,7 @@ require "active_support" require "active_support/test_case" ActiveSupport::TestCase.extend Rails::LineFiltering +Rails::TestUnitReporter.app_root = COMPONENT_ROOT Rails::TestUnitReporter.executable = "bin/test" Rails::TestUnit::Runner.parse_options(ARGV)