Skip to content

Commit 371df0f

Browse files
committed
Join thread in udp_server_loop_spec.rb
1 parent 6300a03 commit 371df0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/ruby/library/socket/socket/udp_server_loop_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
it 'yields the message and a Socket::UDPSource' do
2222
msg, src = nil
2323

24-
Thread.new do
24+
thread = Thread.new do
2525
SocketSpecs::ServerLoopPortFinder.udp_server_loop('127.0.0.1', 0) do |message, source|
2626
msg = message
2727
src = source
@@ -52,6 +52,8 @@
5252

5353
msg.should == 'hello'
5454
src.should be_an_instance_of(Socket::UDPSource)
55+
56+
thread.join
5557
end
5658
end
5759
end

0 commit comments

Comments
 (0)