Skip to content

Commit 069ff05

Browse files
committed
Add tests for the address info
1 parent 4ff8e37 commit 069ff05

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/modules/post/test/socket_channels.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ def udp_socket_pair(params)
4545
def test_tcp_client_channel
4646
print_status('Running TCP client channel tests...')
4747

48+
it 'Has the correct peer information' do
49+
client, server_client = tcp_socket_pair({'PeerHost' => '127.0.0.1'})
50+
address = server_client.local_address
51+
ret = client.peerhost == address.ip_address && client.peerport == address.ip_port
52+
client.close
53+
server_client.close
54+
ret
55+
end
56+
4857
it 'Receives data from the peer' do
4958
client, server_client = tcp_socket_pair({'PeerHost' => '127.0.0.1'})
5059
data = Random.new.bytes(rand(10..100))

0 commit comments

Comments
 (0)