Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tests for eager_load config option rake tasks #10195

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions railties/test/application/rake_test.rb
Expand Up @@ -79,6 +79,23 @@ def world
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` }
Expand Down