test/appender/udp_test.rb in semantic_logger-4.2.0 vs test/appender/udp_test.rb in semantic_logger-4.2.1
- old
+ new
@@ -10,11 +10,11 @@
end
SemanticLogger::LEVELS.each do |level|
it "send #{level}" do
data = nil
- @appender.socket.stub(:send, -> d, flags { data = d }) do
+ @appender.socket.stub(:send, ->(d, _flags) { data = d }) do
@appender.send(level, @message)
end
hash = JSON.parse(data)
assert_equal @message, hash['message']
assert_equal level.to_s, hash['level']
@@ -27,11 +27,11 @@
Uh oh
rescue Exception => e
exc = e
end
data = nil
- @appender.socket.stub(:send, -> d, flags { data = d }) do
+ @appender.socket.stub(:send, ->(d, _flags) { data = d }) do
@appender.send(level, 'Reading File', exc)
end
hash = JSON.parse(data)
assert 'Reading File', hash['message']
assert 'NameError', hash['exception']['name']
@@ -40,21 +40,20 @@
assert hash['exception']['stack_trace'].first.include?(__FILE__), hash['exception']
end
it "send #{level} custom attributes" do
data = nil
- @appender.socket.stub(:send, -> d, flags { data = d }) do
- @appender.send(level, @message, {key1: 1, key2: 'a'})
+ @appender.socket.stub(:send, ->(d, _flags) { data = d }) do
+ @appender.send(level, @message, key1: 1, key2: 'a')
end
hash = JSON.parse(data)
assert_equal @message, hash['message']
assert_equal level.to_s, hash['level']
refute hash['stack_trace']
assert payload = hash['payload'], hash
assert_equal 1, payload['key1'], payload
assert_equal 'a', payload['key2'], payload
end
-
end
end
end
end