diff --git a/test/test_logger_initializer.rb b/test/test_logger_initializer.rb index 149b397ce4..a476841010 100644 --- a/test/test_logger_initializer.rb +++ b/test/test_logger_initializer.rb @@ -7,15 +7,15 @@ class LoggerInitializerTest < ::Test::Unit::TestCase def setup @stored_global_logger = $log Dir.mktmpdir do |tmp_dir| - begin - @tmp_dir = Pathname(tmp_dir) - yield - ensure - $log = @stored_global_logger - end + @tmp_dir = Pathname(tmp_dir) + yield end end + def teardown + $log = @stored_global_logger + end + test 'when path is given' do path = @tmp_dir + 'log' + 'fluent_with_path.log' logger = Fluent::Supervisor::LoggerInitializer.new(path.to_s, Fluent::Log::LEVEL_DEBUG, nil, nil, {})