Permalink
Browse files

Merge pull request #12778 from etehtsea/rake-default-fix

Don't load test env by default.

Closes #13241
  • Loading branch information...
1 parent bbb4566 commit 38cf00e553bc709cd1f9c4b14992d9730554f757 @rafaelfranca rafaelfranca committed Mar 28, 2014
Showing with 5 additions and 1 deletion.
  1. +4 −0 railties/CHANGELOG.md
  2. +1 −1 railties/lib/rails/test_unit/railtie.rb
View
@@ -1,3 +1,7 @@
+* Do not set the Rails environment to test by default when using test_unit Railtie.
+
+ *Konstantin Shabanov*
+
* Introduce `Rails.gem_version` as a convenience method to return
`Gem::Version.new(Rails.version)`, suggesting a more reliable way to perform
version comparison.
@@ -1,4 +1,4 @@
-if defined?(Rake.application) && Rake.application.top_level_tasks.grep(/^(default$|test(:|$))/).any?
+if defined?(Rake.application) && Rake.application.top_level_tasks.grep(/^test(?::|$)/).any?
ENV['RAILS_ENV'] ||= 'test'
end

0 comments on commit 38cf00e

Please sign in to comment.