diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-09-08 05:32:16 -0700 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-09-08 05:32:16 -0700 |
commit | 2b41343c34bcbe809537590152506690b84832df (patch) | |
tree | 69f539c5aac0ff73901eac2df5512b0cb9d3f947 /railties | |
parent | c3207a12be646483e7e0ce8c916e730e7ea5070d (diff) | |
download | rails-2b41343c34bcbe809537590152506690b84832df.tar.gz rails-2b41343c34bcbe809537590152506690b84832df.tar.bz2 rails-2b41343c34bcbe809537590152506690b84832df.zip |
Default to sorting user's test cases for now
Goals:
1. Default to :random for newly generated applications
2. Default to :sorted for existing applications with a warning
3. Only show the warning once
4. Only show the warning if the app actually uses AS::TestCase
Fixes #16769
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt | 3 | ||||
-rw-r--r-- | railties/test/abstract_unit.rb | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt index 053f5b66d7..32756eb88b 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt @@ -31,6 +31,9 @@ Rails.application.configure do # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test + # Randomize the order test cases are executed + config.active_support.test_order = :random + # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index d8800eaa0f..3810f0e14f 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -30,7 +30,7 @@ end class ActiveSupport::TestCase # FIXME: we have tests that depend on run order, we should fix that and # remove this method call. - self.my_tests_are_order_dependent! + self.test_order = :sorted private |