test/logger_test.rb in semantic_logger-0.0.2 vs test/logger_test.rb in semantic_logger-0.1.0
- old
+ new
@@ -21,21 +21,22 @@
SemanticLogger::Logger.appenders << @appender
# Use this test's class name as the application name in the log output
@logger = SemanticLogger::Logger.new('LoggerTest', :level => :trace)
- @hash = { :tracking_number => 12345, :session_id => 'HSSKLEU@JDK767'}
+ @hash = { :session_id => 'HSSKLEU@JDK767', :tracking_number => 12345 }
end
teardown do
SemanticLogger::Logger.appenders.delete(@appender)
end
# Ensure that any log level can be logged
SemanticLogger::Logger::LEVELS.each do |level|
should "log #{level} info" do
@logger.send(level, 'hello world', @hash) { "Calculations" }
- assert_match /\d+-\d+-\d+ \d+:\d+:\d+.\d+ \w \[\d+:\w+\] LoggerTest -- hello world -- \{:session_id=>\"HSSKLEU@JDK767\", :tracking_number=>12345\} -- Calculations\n/, @mock_logger.message
+ @logger.flush
+ assert_match /\d+-\d+-\d+ \d+:\d+:\d+.\d+ \w \[\d+:.+\] LoggerTest -- hello world -- Calculations -- \{:session_id=>\"HSSKLEU@JDK767\", :tracking_number=>12345\}\n/, @mock_logger.message
end
end
end
\ No newline at end of file