test/appender/wrapper_test.rb in semantic_logger-3.2.1 vs test/appender/wrapper_test.rb in semantic_logger-3.3.0

- old
+ new

@@ -17,49 +17,49 @@ it 'handle nil name, message and payload' do log = SemanticLogger::Log.new log.time = Time.now log.level = :debug @appender.log(log) - assert_match /\d+-\d+-\d+ \d+:\d+:\d+.\d+ D \[\d+:\] /, @mock_logger.message + assert_match(/\d+-\d+-\d+ \d+:\d+:\d+.\d+ D \[\d+:\] /, @mock_logger.message) end it 'handle nil message and payload' do log = SemanticLogger::Log.new log.time = Time.now log.level = :debug log.name = 'class' @appender.log(log) - assert_match /\d+-\d+-\d+ \d+:\d+:\d+.\d+ D \[\d+:\] class/, @mock_logger.message + assert_match(/\d+-\d+-\d+ \d+:\d+:\d+.\d+ D \[\d+:\] class/, @mock_logger.message) end it 'handle nil payload' do log = SemanticLogger::Log.new log.time = Time.now log.level = :debug log.name = 'class' log.message = 'hello world' @appender.log(log) - assert_match /\d+-\d+-\d+ \d+:\d+:\d+.\d+ D \[\d+:\] class -- hello world/, @mock_logger.message + assert_match(/\d+-\d+-\d+ \d+:\d+:\d+.\d+ D \[\d+:\] class -- hello world/, @mock_logger.message) end it 'handle payload' do log = SemanticLogger::Log.new log.time = Time.now log.level = :debug log.name = 'class' log.message = 'hello world' log.payload = @hash @appender.log(log) - assert_match /\d+-\d+-\d+ \d+:\d+:\d+.\d+ D \[\d+:\] class -- hello world -- #{@hash_str}/, @mock_logger.message + assert_match(/\d+-\d+-\d+ \d+:\d+:\d+.\d+ D \[\d+:\] class -- hello world -- #{@hash_str}/, @mock_logger.message) end end describe 'for each log level' do # Ensure that any log level can be logged Logger::Severity.constants.each do |level| it "log #{level.downcase.to_sym} info" do @appender.log SemanticLogger::Log.new(level.downcase.to_sym, 'thread', 'class', 'hello world', @hash, Time.now) - assert_match /\d+-\d+-\d+ \d+:\d+:\d+.\d+ \w \[\d+:thread\] class -- hello world -- #{@hash_str}/, @mock_logger.message + assert_match(/\d+-\d+-\d+ \d+:\d+:\d+.\d+ \w \[\d+:thread\] class -- hello world -- #{@hash_str}/, @mock_logger.message) end end end end