diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-06 09:43:57 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-06 09:43:57 -0700 |
commit | 6acb858d06fa0873135eea0957a4aa5ea2fd0d2b (patch) | |
tree | 45d323bd1031481bfcf06e06797fef066c53f461 /railties/test/application/rake_test.rb | |
parent | cae68d221cc81232e30049eafa4ff59b2c5f6010 (diff) | |
parent | cb2d811ebbf3c3c9941618813f73261b3449eecf (diff) | |
download | rails-6acb858d06fa0873135eea0957a4aa5ea2fd0d2b.tar.gz rails-6acb858d06fa0873135eea0957a4aa5ea2fd0d2b.tar.bz2 rails-6acb858d06fa0873135eea0957a4aa5ea2fd0d2b.zip |
Merge pull request #389 from jasonrudolph/always_flush_logger_at_exit
Always flush logger at exit
Diffstat (limited to 'railties/test/application/rake_test.rb')
-rw-r--r-- | railties/test/application/rake_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index a8bcf7beaf..d77c2d14ab 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -73,6 +73,19 @@ module ApplicationTests assert_match 'custom_assets GET /custom/assets(.:format)', Dir.chdir(app_path){ `rake routes` } end + def test_logger_is_flushed_when_exiting_production_rake_tasks + add_to_config <<-RUBY + rake_tasks do + task :log_something => :environment do + Rails.logger.error("Sample log message") + end + end + RUBY + + output = Dir.chdir(app_path){ `rake log_something RAILS_ENV=production && cat log/production.log` } + assert_match "Sample log message", output + end + def test_model_and_migration_generator_with_change_syntax Dir.chdir(app_path) do `rails generate model user username:string password:string` |