I add these tests to class TestSyslogLoggerin test_syslog_logger.rb
def test_add_with_percentage
msg = log_add Logger::INFO, 'info level message with percentage %'
assert_equal 'INFO - info level message with percentage %%', msg.line
end
def test_info_with_percentage
msg = @logger.info 'info level message with percentage %'
assert_equal 'INFO - info level message with percentage %%', MockSyslog::line
end
It seems to me the same message should be logged.
I get this failure:
$ ruby test_syslog_logger.rb -n /with_percentage/
Loaded suite test_syslog_logger
Started
F.
Finished in 0.002746 seconds.
1) Failure:
test_add_with_percentage(TestSyslogLogger) [test_syslog_logger.rb:492]:
<"INFO - info level message with percentage %%"> expected but was
<"INFO - info level message with percentage %%%%">.
2 tests, 3 assertions, 1 failures, 0 errors, 0 skips
The method SyslogLogger#add invokes clean twice. It looks like a typo.
Stephan |