diff options
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/configuration_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 6158c416d7..02d8b2c91d 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -754,7 +754,7 @@ module ApplicationTests end end - test "config.log_level with custom logger" do + test "lookup config.log_level with custom logger (stdlib Logger)" do make_basic_app do |app| app.config.logger = Logger.new(STDOUT) app.config.log_level = :info @@ -762,6 +762,19 @@ module ApplicationTests assert_equal Logger::INFO, Rails.logger.level end + test "assign log_level as is with custom logger (third party logger)" do + logger_class = Class.new do + attr_accessor :level + end + logger_instance = logger_class.new + make_basic_app do |app| + app.config.logger = logger_instance + app.config.log_level = :info + end + assert_equal logger_instance, Rails.logger + assert_equal :info, Rails.logger.level + end + test "respond_to? accepts include_private" do make_basic_app |