test/appender/udp_test.rb in semantic_logger-3.4.1 vs test/appender/udp_test.rb in semantic_logger-4.0.0.beta1

- old
+ new

@@ -1,16 +1,14 @@ require_relative '../test_helper' # Unit Test for SemanticLogger::Appender::Tcp module Appender class UdpTest < Minitest::Test - response_mock = Struct.new(:code, :body) - describe SemanticLogger::Appender::Udp do before do @appender = SemanticLogger::Appender::Udp.new(server: 'localhost:8088') - @message = 'AppenderUdpTest log message' + @message = 'AppenderUdpTest log message' end SemanticLogger::LEVELS.each do |level| it "send #{level}" do data = nil @@ -49,11 +47,12 @@ end hash = JSON.parse(data) assert_equal @message, hash['message'] assert_equal level.to_s, hash['level'] refute hash['stack_trace'] - assert_equal 1, hash['key1'], hash - assert_equal 'a', hash['key2'], hash + assert payload = hash['payload'], hash + assert_equal 1, payload['key1'], payload + assert_equal 'a', payload['key2'], payload end end end end