Sha256: 59b8b9899a130f140d34b3a00c8d03f8659fed84d36f417e6c108d447ad1474c
Contents?: true
Size: 745 Bytes
Versions: 37
Compression:
Stored size: 745 Bytes
Contents
module Omnibus module RSpec module LoggingHelpers # # Grab the result of the log command. Since Omnibus uses the block form of # the logger, this method handles both types of logging. # # @example # output = capture_logging { some_command } # expect(output).to include('whatever') # def capture_logging original = Omnibus.logger Omnibus.logger = TestLogger.new yield Omnibus.logger.output ensure Omnibus.logger = original end class TestLogger < Logger def initialize(*) super(StringIO.new) @level = -1 end def output io.string end end end end end
Version data entries
37 entries across 37 versions & 1 rubygems