Isolate rake action tests that should be run under default env

This commit is contained in:
Guillermo Iguaran 2011-10-08 16:27:22 -05:00
parent 2274c9212e
commit f655895e87

@ -180,9 +180,11 @@ def test_generate_should_run_script_generate_with_argument_and_options
end
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)
generator.expects(:run).once.with("rake log:clear RAILS_ENV=development", :verbose => false)
old_env, ENV['RAILS_ENV'] = ENV["RAILS_ENV"], nil
action :rake, 'log:clear'
ensure
ENV["RAILS_ENV"] = old_env
end
def test_rake_with_env_option_should_run_rake_command_in_env
@ -207,9 +209,11 @@ def test_env_option_should_win_over_rails_env_variable_when_running_rake
end
def test_rake_with_sudo_option_should_run_rake_command_with_sudo
expected_env = ENV['RAILS_ENV'] || 'development'
generator.expects(:run).once.with("sudo rake log:clear RAILS_ENV=#{expected_env}", :verbose => false)
generator.expects(:run).once.with("sudo rake log:clear RAILS_ENV=development", :verbose => false)
old_env, ENV['RAILS_ENV'] = ENV["RAILS_ENV"], nil
action :rake, 'log:clear', :sudo => true
ensure
ENV["RAILS_ENV"] = old_env
end
def test_capify_should_run_the_capify_command