提交 e334ec4f 编写于 作者: V Victor Costan

Avoid crashing when minitest-rails is loaded.

The improvments to the test runner's integration with minitest in commit
b6fc8e25 add methods to the Minitest
module that refer to the Rails module. Unfortunately, when the
minitest-rails gem is loaded, the reference is incorrectly resolved to
the Minitest::Rails module.
上级 bc6ac860
......@@ -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.
先完成此消息的编辑!
想要评论请 注册