spec/interfaces/udp_interface_spec.rb in cosmos-3.0.0 vs spec/interfaces/udp_interface_spec.rb in cosmos-3.0.1
- old
+ new
@@ -107,10 +107,11 @@
i = UdpInterface.new('localhost','8888','nil')
thread = Thread.new { i.read }
sleep 0.1
thread.stop?.should be_truthy
thread.kill
+ thread.join
end
it "should stop the read thread if there is an IOError" do
read = double("read")
allow(read).to receive(:read).and_raise(IOError)
@@ -119,9 +120,10 @@
i.connect
thread = Thread.new { i.read }
sleep 0.1
thread.stop?.should be_truthy
thread.kill
+ thread.join
end
it "should count the packets received" do
read = double("read")
allow(read).to receive(:read) { "\x00\x01\x02\x03" }