提交 1099e54b 编写于 作者: K Kasper Timm Hansen

Merge pull request #20747 from pwnall/fix_minitest_rails

Avoid crashing when minitest-rails is loaded.
......@@ -34,14 +34,14 @@ def self.plugin_rails_init(options)
ENV["RAILS_ENV"] = options[:environment] || "test"
Rails::TestRequirer.require_files options[:patterns] unless run_with_autorun
::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)
Minitest.backtrace_filter = ::Rails.backtrace_cleaner if ::Rails.respond_to?(:backtrace_cleaner)
end
self.reporter << Rails::TestUnitReporter.new(options[:io], options)
self.reporter << ::Rails::TestUnitReporter.new(options[:io], options)
end
mattr_accessor(:run_with_autorun) { false }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册