1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
require 'spec_helper'
describe UDPSocket do
let(:udp_port) { 23456 }
let :readable_subject do
sock = UDPSocket.new
sock.bind('localhost', udp_port)
peer = UDPSocket.new
peer.send("hi there", 0, 'localhost', udp_port)
sock
end
let :unreadable_subject do
sock = UDPSocket.new
sock.bind('localhost', udp_port + 1)
sock
end
let :writable_subject do
pending "come up with a writable UDPSocket example"
end
let :unwritable_subject do
pending "come up with a UDPSocket that's blocked on writing"
end
it_behaves_like "an NIO selectable"
end
|