diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2021-03-29 23:53:03 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-29 23:53:03 -0600 |
| commit | ab7d3bd2a97b2fcce250ad64e017fd4ebe557364 (patch) | |
| tree | f6d92d93867e14e3e277dc4cf564015270695a6c /test/logger_test.rb | |
| parent | ba098bef99206e08cab9304574720e93eb7a938b (diff) | |
resolves #3982 allow NullLogger to be enabled by setting the :logger option to a falsy value (PR #3983)
Diffstat (limited to 'test/logger_test.rb')
| -rw-r--r-- | test/logger_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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 |
