From ab7d3bd2a97b2fcce250ad64e017fd4ebe557364 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Mon, 29 Mar 2021 23:53:03 -0600 Subject: resolves #3982 allow NullLogger to be enabled by setting the :logger option to a falsy value (PR #3983) --- test/logger_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/logger_test.rb') diff --git a/test/logger_test.rb b/test/logger_test.rb index 77a0792e..87d18c75 100644 --- a/test/logger_test.rb +++ b/test/logger_test.rb @@ -129,6 +129,18 @@ context 'Logger' do Asciidoctor::LoggerManager.logger = old_logger end end + + test 'should be able to set logger to NullLogger by setting :logger option to a falsy value' do + [nil, false].each do |falsy_val| + old_logger = Asciidoctor::LoggerManager.logger + begin + Asciidoctor.load 'contents', logger: falsy_val + assert_kind_of Asciidoctor::NullLogger, Asciidoctor::LoggerManager.logger + ensure + Asciidoctor::LoggerManager.logger = old_logger + end + end + end end context 'Logging' do -- cgit v1.2.3