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

- old
+ new

@@ -1,12 +1,10 @@ require_relative '../test_helper' # Unit Test for SemanticLogger::Appender::Tcp module Appender class TcpTest < Minitest::Test - response_mock = Struct.new(:code, :body) - describe SemanticLogger::Appender::Tcp do before do Net::TCPClient.stub_any_instance(:connect, true) do @appender = SemanticLogger::Appender::Tcp.new(server: 'localhost:8088') end @@ -56,11 +54,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