spec/syslogger_spec.rb in syslogger-1.6.0 vs spec/syslogger_spec.rb in syslogger-1.6.1
- old
+ new
@@ -168,9 +168,18 @@
with("my_app", Syslog::LOG_PID, Syslog::LOG_USER).
and_yield(syslog=double("syslog", :mask= => true))
syslog.should_receive(:log).with(Syslog::LOG_INFO, "a"*480).twice
@logger.add(Logger::INFO, "a"*960)
end
+
+ it "should apply the log formatter to the message" do
+ Syslog.stub(:open).and_yield(syslog=double("syslog", :mask= => true))
+ syslog.should_receive(:log).with(Syslog::LOG_INFO, "test message!")
+ @logger.formatter = proc do |severity, datetime, progname, msg|
+ "test #{msg}!"
+ end
+ @logger.add(Logger::INFO, "message")
+ end
end # describe "add"
describe "max_octets=" do
before(:each) do
@logger = Syslogger.new("my_app", Syslog::LOG_PID, Syslog::LOG_USER)