Permalink
Browse files

Merge pull request #26637 from y-yagi/prevent_plugin_test_run_twice

use `active_support/testing/autorun` in `bin/test` script
  • Loading branch information...
kaspth committed Sep 27, 2016
2 parents ebcd965 + 1269795 commit 21ecf42730de2004a95d913038c1f417c24496be
@@ -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"

0 comments on commit 21ecf42

Please sign in to comment.