Implement Env#log_logger_level
This commit is contained in:
parent
0d0eac111c
commit
404b34acc0
@ -1,6 +1,8 @@
|
||||
module Uh
|
||||
module WM
|
||||
class Env
|
||||
LOGGER_LEVEL_STRINGS = %w[DEBUG INFO WARN ERROR FATAL UNKNOWN]
|
||||
|
||||
extend Forwardable
|
||||
def_delegator :@logger, :info, :log
|
||||
def_delegator :@output, :print
|
||||
@ -16,6 +18,10 @@ module Uh
|
||||
def verbose?
|
||||
!!@verbose
|
||||
end
|
||||
|
||||
def log_logger_level
|
||||
log "Logging at #{LOGGER_LEVEL_STRINGS[@logger.level]} level"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -40,6 +40,13 @@ module Uh
|
||||
end
|
||||
end
|
||||
|
||||
describe '#log_logger_level' do
|
||||
it 'logs the logger level' do
|
||||
expect(logger).to receive(:info).with /log.+(warn|info|debug).+level/i
|
||||
env.log_logger_level
|
||||
end
|
||||
end
|
||||
|
||||
describe '#print' do
|
||||
it 'prints the message to the output' do
|
||||
env.print 'some message'
|
||||
|
Loading…
x
Reference in New Issue
Block a user