Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (20 sloc) 0.6 kb
require File.dirname(__FILE__) + '/spec_helper'
include Madvertise::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
Jump to Line
Something went wrong with that request. Please try again.