spec/syslogger_spec.rb in syslogger-1.4.1 vs spec/syslogger_spec.rb in syslogger-1.4.2
- old
+ new
@@ -130,10 +130,31 @@
with("my_app", Syslog::LOG_PID, Syslog::LOG_USER).
and_yield(syslog=mock("syslog", :mask= => true))
syslog.should_receive(:log).with(Syslog::LOG_INFO, "my_app")
@logger.add(Logger::INFO, nil)
end
+
+ it "should split string over the max octet size" do
+ @logger.max_octets = 480
+ Syslog.should_receive(:open).
+ with("my_app", Syslog::LOG_PID, Syslog::LOG_USER).
+ and_yield(syslog=mock("syslog", :mask= => true))
+ syslog.should_receive(:log).with(Syslog::LOG_INFO, "a"*480).twice
+ @logger.add(Logger::INFO, "a"*960)
+ end
end # describe "add"
+
+ describe "max_octets=" do
+ before(:each) do
+ @logger = Syslogger.new("my_app", Syslog::LOG_PID, Syslog::LOG_USER)
+ end
+
+ it "should set the max_octets for the logger" do
+ lambda { @logger.max_octets = 1 }.should change(@logger, :max_octets)
+ @logger.max_octets.should == 1
+ end
+
+ end
describe "level=" do
before(:each) do
@logger = Syslogger.new("my_app", Syslog::LOG_PID, Syslog::LOG_USER)
end