plugin_rails_init(options)
public
Owes great inspiration to test runner trailblazers like RSpec,
minitest-reporters, maxitest and others.
# File railties/lib/rails/test_unit/minitest_plugin.rb, line 71
def self.plugin_rails_init(options)
self.run_with_rails_extension = true
ENV["RAILS_ENV"] = options[:environment] || "test"
::Rails::TestRequirer.require_files(options[:patterns]) unless run_with_autorun
unless options[:full_backtrace] || ENV["BACKTRACE"]
# Plugin can run without Rails loaded, check before filtering.
Minitest.backtrace_filter = ::Rails.backtrace_cleaner if ::Rails.respond_to?(:backtrace_cleaner)
end
# Replace progress reporter for colors.
reporter.reporters.delete_if { |reporter| reporter.kind_of?(SummaryReporter) || reporter.kind_of?(ProgressReporter) }
reporter << SuppressedSummaryReporter.new(options[:io], options)
reporter << ::Rails::TestUnitReporter.new(options[:io], options)
end