Skip to content

Commit

Permalink
Test: Refactor logic of recovering global logger
Browse files Browse the repository at this point in the history
Signed-off-by: Daijiro Fukuda <[email protected]>
  • Loading branch information
daipom committed Feb 16, 2023
1 parent ade4857 commit 60c94ad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/test_logger_initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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, {})
Expand Down

0 comments on commit 60c94ad

Please sign in to comment.