test/functional/formatting.rb in chalk-log-0.1.3 vs test/functional/formatting.rb in chalk-log-0.1.4

- old
+ new

@@ -76,9 +76,16 @@ it 'log entry from info' do rendered = layout(data: ["A Message", {:key1 => "ValueOne", :key2 => ["An", "Array"]}]) assert_equal('[9973] A Message: key1=ValueOne key2=["An","Array"]', rendered) end + it 'logs the message_prefix correctly' do + Chalk::Log.with_message_prefix('PREFIX: ') do + rendered = layout(data: ["A Message", {:key1 => "ValueOne", :key2 => ["An", "Array"]}]) + assert_equal('[9973] PREFIX: A Message: key1=ValueOne key2=["An","Array"]', rendered) + end + end + it 'logs the action_id correctly' do LSpace.with(action_id: 'action') do rendered = layout(data: ["A Message", {:key1 => "ValueOne", :key2 => ["An", "Array"]}]) assert_equal('[9973|action] A Message: key1=ValueOne key2=["An","Array"]', rendered) end