Permalink
Browse files

default RAILS_ENV to test if we're in a test task

  • Loading branch information...
1 parent 1a838cc commit 2e68ecccf7ef86833cab2a99b0a42688f3fe88ac @tenderlove tenderlove committed Mar 25, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 railties/lib/rails/all.rb
@@ -1,5 +1,9 @@
require "rails"
+if defined?(Rake) && Rake.application.top_level_tasks.grep(/^test(?::|$)/).any?
+ ENV['RAILS_ENV'] ||= 'test'
+end
+
%w(
active_record
action_controller

0 comments on commit 2e68ecc

Please sign in to comment.