spec/syslogger_spec.rb in syslogger-1.2.1 vs spec/syslogger_spec.rb in syslogger-1.2.2
- old
+ new
@@ -49,9 +49,15 @@
it "should use the given progname" do
Syslog.should_receive(:open).with("progname", Syslog::LOG_PID, Syslog::LOG_USER).and_yield(syslog=mock("syslog", :mask= => true))
syslog.should_receive(:log).with(Syslog::LOG_INFO, "message")
@logger.add(Logger::INFO, "message", "progname") { "my message" }
end
+
+ 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
end # describe "add"
describe ":level? methods" do
before(:each) do
@logger = Syslogger.new("my_app", Syslog::LOG_PID, Syslog::LOG_USER)