Skip to content

Commit

Permalink
Fix test to pass with v0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
sonots committed Sep 15, 2017
1 parent 2d4a705 commit 00b427f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@

class Test::Unit::TestCase
def capture_log(log)
tmp = log.out
log.out = StringIO.new
yield
return log.out.string
ensure
log.out = tmp
if defined?(Fluent::Test::TestLogger) and log.is_a?(Fluent::Test::TestLogger) # v0.14
yield
log.out.logs.join("\n")
else
begin
tmp = log.out
log.out = StringIO.new
yield
return log.out.string
ensure
log.out = tmp
end
end
end
end

0 comments on commit 00b427f

Please sign in to comment.