aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/test/generators/actions_test.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb
index e621f7f6f7..d5301dcdb2 100644
--- a/railties/test/generators/actions_test.rb
+++ b/railties/test/generators/actions_test.rb
@@ -179,8 +179,9 @@ class ActionsTest < Rails::Generators::TestCase
action :generate, 'model', 'MyModel'
end
- def test_rake_should_run_rake_command_with_development_env
- generator.expects(:run).once.with('rake log:clear RAILS_ENV=development', :verbose => false)
+ def test_rake_should_run_rake_command_with_default_env
+ expected_env = ENV['RAILS_ENV'] || 'development'
+ generator.expects(:run).once.with("rake log:clear RAILS_ENV=#{expected_env}", :verbose => false)
action :rake, 'log:clear'
end
@@ -206,7 +207,8 @@ class ActionsTest < Rails::Generators::TestCase
end
def test_rake_with_sudo_option_should_run_rake_command_with_sudo
- generator.expects(:run).once.with('sudo rake log:clear RAILS_ENV=development', :verbose => false)
+ expected_env = ENV['RAILS_ENV'] || 'development'
+ generator.expects(:run).once.with("sudo rake log:clear RAILS_ENV=#{expected_env}", :verbose => false)
action :rake, 'log:clear', :sudo => true
end