提交 21ecf427 编写于 作者: K Kasper Timm Hansen 提交者: GitHub

Merge pull request #26637 from y-yagi/prevent_plugin_test_run_twice

use `active_support/testing/autorun` in `bin/test` script
......@@ -5,4 +5,6 @@ require 'rails/test_unit/minitest_plugin'
Rails::TestUnitReporter.executable = 'bin/test'
exit Minitest.run(ARGV)
Minitest.run_via[:rails] = true
require "active_support/testing/autorun"
......@@ -86,6 +86,12 @@ def test_raise_error_when_specified_file_does_not_exist
assert_match(%r{cannot load such file.+test/not_exists\.rb}, error)
end
def test_executed_only_once
create_test_file "foo"
result = run_test_command("test/foo_test.rb")
assert_equal 1, result.scan(/1 runs, 1 assertions, 0 failures/).length
end
private
def plugin_path
"#{@destination_root}/bukkits"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册