spec/slogger/common_logger_spec.rb in slogger-0.0.6 vs spec/slogger/common_logger_spec.rb in slogger-0.0.7

- old
+ new

@@ -58,54 +58,54 @@ subject { Slogger::CommonLogger.new "test_app", :warn, :local0 } it { should respond_to(:add) } it "should log ERROR messsages with the add method" do - Syslog.should_receive(:err).with('ERROR message').and_return(Syslog) + Syslog.should_receive(:err).with('%s','ERROR message').and_return(Syslog) subject.add(:error, 'ERROR message') end it "should log UNKNOW messages" do - Syslog.should_receive(:emerg).with(anything).and_return(Syslog) + Syslog.should_receive(:emerg).with('%s',anything).and_return(Syslog) subject.unknow "UNKNOW message" end it "should log FATAL messages" do - Syslog.should_receive(:alert).with(anything).and_return(Syslog) + Syslog.should_receive(:alert).with('%s',anything).and_return(Syslog) subject.fatal "FATAL message" end it "should log ERROR messages" do - Syslog.should_receive(:err).with(anything).and_return(Syslog) + Syslog.should_receive(:err).with('%s',anything).and_return(Syslog) subject.error "ERROR message" end it "should log WARN messsages with the add method to the WARNING severity" do - Syslog.should_receive(:warning).with('WARN message').and_return(Syslog) + Syslog.should_receive(:warning).with('%s','WARN message').and_return(Syslog) subject.add(:warn, 'WARN message') end it "should log WARN messages to the WARNING severity" do - Syslog.should_receive(:warning).with(anything).and_return(Syslog) + Syslog.should_receive(:warning).with('%s',anything).and_return(Syslog) subject.warn "WARN message" end it "shouldn't log INFO messages" do - Syslog.should_not_receive(:info).with(anything).and_return(Syslog) + Syslog.should_not_receive(:info).with('%s',anything).and_return(Syslog) subject.info "INFO message" end describe "but when severity is changed to INFO" do it "should log INFO messages" do subject.severity = :info - Syslog.should_receive(:info).with(anything).and_return(Syslog) + Syslog.should_receive(:info).with('%s',anything).and_return(Syslog) subject.info "INFO message" end end end @@ -115,18 +115,18 @@ subject.severity = :info messenger = mock('messenger') messenger.should_receive(:message).and_return('this is a message %{name}') - Syslog.should_receive(:info).with('this is a message logger').and_return(Syslog) + Syslog.should_receive(:info).with('%s','this is a message logger').and_return(Syslog) subject.info { messenger.message % {:name => 'logger'} } end end describe "when a block is passed to log method" do it "should add spent time to the message" do - Syslog.should_receive(:info).with(/\[time: [0-9.]+\] a block wrapped by log/) + Syslog.should_receive(:info).with('%s',/\[time: [0-9.]+\] a block wrapped by log/) subject.info "a block wrapped by log" do sleep(1) end end