mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #26637 from y-yagi/prevent_plugin_test_run_twice
use `active_support/testing/autorun` in `bin/test` script
This commit is contained in:
parent
d8e311fd9f
commit
5995a86487
2 changed files with 9 additions and 1 deletions
|
@ -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 @@ class PluginTestRunnerTest < ActiveSupport::TestCase
|
|||
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"
|
||||
|
|
Loading…
Reference in a new issue