mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
The generator invokes rake with either the :env option, ENV['RAILS_ENV'], or development. So if Travis has exported RAILS_ENV=test, it'll be used instead of development, breaking these brittle expectations.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user