1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

use active_support/testing/autorun in bin/test script

29f0fbd5db has changed that always call
`Minitest.autorun` in `active_support/testing/autorun`.

Therefore, when used directly `Minitest.run`, tests are performed twice.
This commit is contained in:
yuuji.yaginuma 2016-09-27 12:12:12 +09:00
parent c994a893c1
commit 1269795ae2
2 changed files with 9 additions and 1 deletions

View file

@ -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"

View file

@ -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"