test/formatters/default_test.rb in semantic_logger-4.1.0 vs test/formatters/default_test.rb in semantic_logger-4.1.1
- old
+ new
@@ -100,11 +100,11 @@
assert_equal "(16m 40s)", formatter.duration
end
it 'logs short duration' do
log.duration = 1.34567
- duration = SemanticLogger::Formatters::Base::PRECISION == 3 ? "(1ms)" : "(1.346ms)"
+ duration = SemanticLogger::Formatters::Base::PRECISION == 3 ? "(1ms)" : "(1.346ms)"
assert_equal duration, formatter.duration
end
end
describe 'name' do
@@ -163,10 +163,10 @@
log.message = "Hello World"
log.payload = {first: 1, second: 2, third: 3}
log.backtrace = backtrace
set_exception
duration = SemanticLogger::Formatters::Base::PRECISION == 3 ? '1' : '1.346'
- str = "#{expected_time} D [#{$$}:#{Thread.current.name} default_test.rb:99] [first] [second] [third] {first: 1, second: 2, third: 3} (#{duration}ms) DefaultTest -- Hello World -- {:first=>1, :second=>2, :third=>3} -- Exception: RuntimeError: Oh no\n"
+ str = "#{expected_time} D [#{$$}:#{Thread.current.name} default_test.rb:99] [first] [second] [third] {first: 1, second: 2, third: 3} (#{duration}ms) DefaultTest -- Hello World -- {:first=>1, :second=>2, :third=>3} -- Exception: RuntimeError: Oh no\n"
assert_equal str, formatter.call(log, nil).lines.first
end
end
end