spec/kamerling/net_dispatcher_spec.rb in kamerling-0.0.1 vs spec/kamerling/net_dispatcher_spec.rb in kamerling-0.0.2

- old
+ new

@@ -4,18 +4,18 @@ describe '#dispatch' do it 'dispatches messages to TCP clients' do server = TCPServer.open 0 thread = Thread.new { server.accept.read } addr = Addr[server.addr[3], server.addr[1], :TCP] - NetDispatcher.new.dispatch addr, 'foo' + NetDispatcher.dispatch addr, 'foo' thread.value.must_equal 'foo' end it 'dispatches messages to UDP clients' do server = UDPSocket.new.tap { |s| s.bind '127.0.0.1', 0 } thread = Thread.new { server.recvfrom(2**16).first } addr = Addr[server.addr[3], server.addr[1], :UDP] - NetDispatcher.new.dispatch addr, 'foo' + NetDispatcher.dispatch addr, 'foo' thread.value.must_equal 'foo' end end end end