diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-06-08 14:51:47 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-06-11 10:50:10 +0200 |
commit | eec932704f3336294a08957b03e4ec1b18198bf1 (patch) | |
tree | ec285fdf04fd553eebb6d1635e243ebcc43cc265 | |
parent | 96bb004fc6e67cdf1b873f11ad5f8efd06949797 (diff) | |
download | rails-eec932704f3336294a08957b03e4ec1b18198bf1.tar.gz rails-eec932704f3336294a08957b03e4ec1b18198bf1.tar.bz2 rails-eec932704f3336294a08957b03e4ec1b18198bf1.zip |
inline test runner check into `as/testing/autorun.rb`.
This makes it possible to easily get the runner working with existing
setups that rely on `active_support/testing/autorun.rb`.
-rw-r--r-- | activesupport/lib/active_support/testing/autorun.rb | 9 | ||||
-rw-r--r-- | railties/lib/rails/test_help.rb | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/testing/autorun.rb b/activesupport/lib/active_support/testing/autorun.rb index 5aa5f46310..84c6b89340 100644 --- a/activesupport/lib/active_support/testing/autorun.rb +++ b/activesupport/lib/active_support/testing/autorun.rb @@ -2,4 +2,11 @@ gem 'minitest' require 'minitest' -Minitest.autorun +if Minitest.respond_to?(:run_with_rails_extension) + unless Minitest.run_with_rails_extension + Minitest.run_with_autorun = true + Minitest.autorun + end +else + Minitest.autorun +end diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb index 3b444b0932..828039dc43 100644 --- a/railties/lib/rails/test_help.rb +++ b/railties/lib/rails/test_help.rb @@ -9,10 +9,7 @@ require 'action_controller/test_case' require 'action_dispatch/testing/integration' require 'rails/generators/test_case' -unless Minitest.run_with_rails_extension - Minitest.run_with_autorun = true - require 'active_support/testing/autorun' -end +require 'active_support/testing/autorun' if defined?(ActiveRecord::Base) ActiveRecord::Migration.maintain_test_schema! |