aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-28 16:17:37 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-31 13:57:24 -0300
commit5da4d5142a60edda0cb78071553993ee33bb8637 (patch)
tree7c9f025bb50cd918c176a429749d221caa27802e
parenteb4930e3c724cf71d6ce5bb2aec4af82b2025b03 (diff)
downloadrails-5da4d5142a60edda0cb78071553993ee33bb8637.tar.gz
rails-5da4d5142a60edda0cb78071553993ee33bb8637.tar.bz2
rails-5da4d5142a60edda0cb78071553993ee33bb8637.zip
Add active_support/testing/autorun
minitest/autorun load minitest/spec polluting the global namespace with the DSL that we don't want on Rails
-rw-r--r--actionmailer/test/abstract_unit.rb2
-rw-r--r--actionpack/test/abstract_unit.rb2
-rw-r--r--actionpack/test/dispatch/routing/inspector_test.rb2
-rw-r--r--actionpack/test/ts_isolated.rb2
-rw-r--r--activemodel/test/cases/helper.rb2
-rw-r--r--activerecord/test/cases/helper.rb3
-rw-r--r--activerecord/test/cases/migration/change_table_test.rb1
-rw-r--r--activesupport/lib/active_support/testing/autorun.rb5
-rw-r--r--activesupport/test/abstract_unit.rb2
-rw-r--r--activesupport/test/ts_isolated.rb2
-rw-r--r--railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb2
-rw-r--r--railties/lib/rails/test_help.rb2
-rw-r--r--railties/test/abstract_unit.rb2
-rw-r--r--railties/test/configuration/middleware_stack_proxy_test.rb3
-rw-r--r--railties/test/isolation/abstract_unit.rb2
15 files changed, 20 insertions, 14 deletions
diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb
index 99c44179fd..15729bafba 100644
--- a/actionmailer/test/abstract_unit.rb
+++ b/actionmailer/test/abstract_unit.rb
@@ -8,7 +8,7 @@ silence_warnings do
Encoding.default_external = "UTF-8"
end
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'action_mailer'
require 'action_mailer/test_case'
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 95bff0a204..bbcd289886 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -15,7 +15,7 @@ silence_warnings do
Encoding.default_external = "UTF-8"
end
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'abstract_controller'
require 'action_controller'
require 'action_view'
diff --git a/actionpack/test/dispatch/routing/inspector_test.rb b/actionpack/test/dispatch/routing/inspector_test.rb
index a3034ce001..c058bd4909 100644
--- a/actionpack/test/dispatch/routing/inspector_test.rb
+++ b/actionpack/test/dispatch/routing/inspector_test.rb
@@ -1,4 +1,4 @@
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'action_controller'
require 'rails/engine'
require 'action_dispatch/routing/inspector'
diff --git a/actionpack/test/ts_isolated.rb b/actionpack/test/ts_isolated.rb
index c44c5d8968..55620abe84 100644
--- a/actionpack/test/ts_isolated.rb
+++ b/actionpack/test/ts_isolated.rb
@@ -1,4 +1,4 @@
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'rbconfig'
require 'abstract_unit'
diff --git a/activemodel/test/cases/helper.rb b/activemodel/test/cases/helper.rb
index 7d6f11b5a5..7a63674757 100644
--- a/activemodel/test/cases/helper.rb
+++ b/activemodel/test/cases/helper.rb
@@ -7,4 +7,4 @@ require 'active_support/core_ext/string/access'
# Show backtraces for deprecated behavior for quicker cleanup.
ActiveSupport::Deprecation.debug = true
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb
index 3a315d843b..5ffb32e809 100644
--- a/activerecord/test/cases/helper.rb
+++ b/activerecord/test/cases/helper.rb
@@ -2,8 +2,7 @@ require File.expand_path('../../../../load_paths', __FILE__)
require 'config'
-gem 'minitest'
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'stringio'
require 'active_record'
diff --git a/activerecord/test/cases/migration/change_table_test.rb b/activerecord/test/cases/migration/change_table_test.rb
index ac1ad176db..8065541bfe 100644
--- a/activerecord/test/cases/migration/change_table_test.rb
+++ b/activerecord/test/cases/migration/change_table_test.rb
@@ -1,4 +1,5 @@
require "cases/migration/helper"
+require "minitest/mock"
module ActiveRecord
class Migration
diff --git a/activesupport/lib/active_support/testing/autorun.rb b/activesupport/lib/active_support/testing/autorun.rb
new file mode 100644
index 0000000000..c446adc16d
--- /dev/null
+++ b/activesupport/lib/active_support/testing/autorun.rb
@@ -0,0 +1,5 @@
+gem 'minitest'
+
+require 'minitest/unit'
+
+MiniTest::Unit.autorun
diff --git a/activesupport/test/abstract_unit.rb b/activesupport/test/abstract_unit.rb
index 8a67b148c3..90e50f235b 100644
--- a/activesupport/test/abstract_unit.rb
+++ b/activesupport/test/abstract_unit.rb
@@ -15,7 +15,7 @@ silence_warnings do
Encoding.default_external = "UTF-8"
end
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'empty_bool'
ENV['NO_RELOAD'] = '1'
diff --git a/activesupport/test/ts_isolated.rb b/activesupport/test/ts_isolated.rb
index 2c217157d3..294d6595f7 100644
--- a/activesupport/test/ts_isolated.rb
+++ b/activesupport/test/ts_isolated.rb
@@ -1,4 +1,4 @@
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'active_support/test_case'
require 'rbconfig'
require 'active_support/core_ext/kernel/reporting'
diff --git a/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb b/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb
index c9af2ca832..30a861f09d 100644
--- a/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb
+++ b/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb
@@ -1,2 +1,2 @@
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'active_support'
diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb
index aed7fd4b14..616206dd0b 100644
--- a/railties/lib/rails/test_help.rb
+++ b/railties/lib/rails/test_help.rb
@@ -2,7 +2,7 @@
# so fixtures aren't loaded into that environment
abort("Abort testing: Your Rails environment is running in production mode!") if Rails.env.production?
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'active_support/test_case'
require 'action_controller/test_case'
require 'action_dispatch/testing/integration'
diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb
index ecd5e03978..491faf4af9 100644
--- a/railties/test/abstract_unit.rb
+++ b/railties/test/abstract_unit.rb
@@ -3,7 +3,7 @@ ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../../../load_paths", __FILE__)
require 'stringio'
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'fileutils'
require 'active_support'
diff --git a/railties/test/configuration/middleware_stack_proxy_test.rb b/railties/test/configuration/middleware_stack_proxy_test.rb
index 5984c0b425..2442cb995d 100644
--- a/railties/test/configuration/middleware_stack_proxy_test.rb
+++ b/railties/test/configuration/middleware_stack_proxy_test.rb
@@ -1,6 +1,7 @@
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'rails/configuration'
require 'active_support/test_case'
+require 'minitest/mock'
module Rails
module Configuration
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index 0cb65f8e0d..172a42a549 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -9,7 +9,7 @@
require 'fileutils'
require 'bundler/setup' unless defined?(Bundler)
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'active_support/test_case'
RAILS_FRAMEWORK_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../..")