mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 21:44:30 +02:00
Pass the Array from select() to Socket.udp_server_recv
* As mentioned in the documentation. * Use Array#size instead of #count, it's more common. * Use :unset, it clarifies things if the specs fails. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
af479d54dc
commit
8552ee87b6
1 changed files with 4 additions and 4 deletions
|
@ -15,15 +15,15 @@ describe 'Socket.udp_server_recv' do
|
|||
end
|
||||
|
||||
it 'yields the message and a Socket::UDPSource' do
|
||||
msg = nil
|
||||
src = nil
|
||||
msg = :unset
|
||||
src = :unset
|
||||
|
||||
@client.write('hello')
|
||||
|
||||
readable, _, _ = IO.select([@server])
|
||||
readable.count.should == 1
|
||||
readable.size.should == 1
|
||||
|
||||
Socket.udp_server_recv([@server]) do |message, source|
|
||||
Socket.udp_server_recv(readable) do |message, source|
|
||||
msg = message
|
||||
src = source
|
||||
break
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue