Sha256: 1149a16884a10d1172a85e6eea126c28eac7502734cda262e6f3d5de4f21de1d

Contents?: true

Size: 596 Bytes

Versions: 4

Compression:

Stored size: 596 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

include Liquid::Logging

describe MultiLogger do

  before(:each) do
    @logger = ImprovedLogger.new
    @logger.level = :debug
    @ml = MultiLogger.new(@logger)
  end

  it "should support attach/detach of loggers" do
    buflog = ImprovedLogger.new(:buffer)
    @ml.attach(buflog)

    $stderr.should_receive(:write).with(/test1/)
    @ml.info("test1")
    buflog.buffer.should match(/test1/)

    @ml.detach(buflog)

    $stderr.should_receive(:write).with(/test2/)
    @ml.info("test2")
    buflog.buffer.should_not match(/test2/)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
liquid-logging-2.0.1 spec/multi_logger_spec.rb
liquid-logging-2.0.1-java spec/multi_logger_spec.rb
liquid-logging-2.0.0 spec/multi_logger_spec.rb
liquid-logging-2.0.0-java spec/multi_logger_spec.rb