aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/test_unit
diff options
context:
space:
mode:
authorwangjohn <wangjohn@mit.edu>2013-04-17 18:10:17 -0400
committerwangjohn <wangjohn@mit.edu>2013-04-23 15:39:18 -0400
commit3ff263919c67588e4348da30cb92b860fe83cba5 (patch)
tree7422e029e21a58464a1ede83527549ef2c2ae115 /railties/lib/rails/test_unit
parente58f11683003ec1515113103895e18a8c9003aa3 (diff)
downloadrails-3ff263919c67588e4348da30cb92b860fe83cba5.tar.gz
rails-3ff263919c67588e4348da30cb92b860fe83cba5.tar.bz2
rails-3ff263919c67588e4348da30cb92b860fe83cba5.zip
Moved the check for the rails test environment into rails/test_unit so that you
can select frameworks separately when running rake test.
Diffstat (limited to 'railties/lib/rails/test_unit')
-rw-r--r--railties/lib/rails/test_unit/railtie.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/railties/lib/rails/test_unit/railtie.rb b/railties/lib/rails/test_unit/railtie.rb
index f52c4c44b7..ab1ebe1f8c 100644
--- a/railties/lib/rails/test_unit/railtie.rb
+++ b/railties/lib/rails/test_unit/railtie.rb
@@ -1,3 +1,7 @@
+if defined?(Rake) && Rake.application.top_level_tasks.grep(/^(default$|test(:|$))/).any?
+ ENV['RAILS_ENV'] ||= 'test'
+end
+
module Rails
class TestUnitRailtie < Rails::Railtie
config.app_generators do |c|