1
0
Fork 0
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:
Kasper Timm Hansen 2016-09-27 16:44:27 +02:00 committed by GitHub
commit 21ecf42730
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"