test/appender/splunk_test.rb in semantic_logger-3.4.1 vs test/appender/splunk_test.rb in semantic_logger-4.0.0.beta1
- old
+ new
@@ -59,14 +59,15 @@
@appender.stub(:service_index, mock) do
@appender.send(level, @message, {key1: 1, key2: 'a'})
end
assert_equal @message, mock.message
- assert mock.event[:event], mock.event.ai
- assert_equal level, mock.event[:event][:level]
- refute mock.event[:event][:stack_trace]
- assert_equal(1, mock.event[:event][:key1], mock.event)
- assert_equal('a', mock.event[:event][:key2], mock.event)
+ assert event = mock.event[:event], mock.event.ai
+ assert_equal level, event[:level]
+ refute event[:stack_trace]
+ assert payload = event[:payload]
+ assert_equal(1, payload[:key1], payload)
+ assert_equal('a', payload[:key2], payload)
end
end
it 'does not send :trace notifications to Splunk when set to :error' do
mock = Mock.new