spec/syslogger_spec.rb in syslogger-1.2.2 vs spec/syslogger_spec.rb in syslogger-1.2.3
- old
+ new
@@ -55,9 +55,15 @@
it "should substitute '%' for '%%' before adding the :message" do
Syslog.stub(:open).and_yield(syslog=mock("syslog", :mask= => true))
syslog.should_receive(:log).with(Syslog::LOG_INFO, "%%me%%ssage%%")
@logger.add(Logger::INFO, "%me%ssage%")
end
+
+ it "should strip the :message" do
+ Syslog.stub(:open).and_yield(syslog=mock("syslog", :mask= => true))
+ syslog.should_receive(:log).with(Syslog::LOG_INFO, "message")
+ @logger.add(Logger::INFO, "\n\nmessage ")
+ end
end # describe "add"
describe ":level? methods" do
before(:each) do
@logger = Syslogger.new("my_app", Syslog::LOG_PID, Syslog::LOG_USER)