diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2013-04-12 12:33:02 -0700 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2013-04-12 12:33:02 -0700 |
commit | c7673b0981d961e5510c85d958c944876d543314 (patch) | |
tree | aad2823c008916f615bc74761d4213661863c287 /railties | |
parent | 70db38572a70f1b1ae53086873c4ce25cf4d34c7 (diff) | |
parent | a49d93552fce0c7076e83d03fae34dc4198c6b9e (diff) | |
download | rails-c7673b0981d961e5510c85d958c944876d543314.tar.gz rails-c7673b0981d961e5510c85d958c944876d543314.tar.bz2 rails-c7673b0981d961e5510c85d958c944876d543314.zip |
Merge pull request #10195 from jetthoughts/eager_load_on_rake_execution_tests
Added tests for `eager_load` config option rake tasks
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/rake_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index eb590da678..fa3ab969ae 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -79,6 +79,23 @@ module ApplicationTests assert_match "Hello world", output end + def test_should_not_eager_load_model_path_for_rake + add_to_config <<-RUBY + config.eager_load = true + + rake_tasks do + task do_nothing: :environment do + end + end + RUBY + + app_file "app/models/hello.rb", <<-RUBY + raise 'should not be pre-required for rake even `eager_load=true`' + RUBY + + Dir.chdir(app_path){ `rake do_nothing` } + end + def test_code_statistics_sanity assert_match "Code LOC: 5 Test LOC: 0 Code to Test Ratio: 1:0.0", Dir.chdir(app_path){ `rake stats` } |