ruby-changes:54790
From: eregon <ko1@a...>
Date: Tue, 5 Feb 2019 18:50:17 +0900 (JST)
Subject: [ruby-changes:54790] eregon:r67009 (trunk): Pass the Array from select() to Socket.udp_server_recv
eregon 2019-02-05 18:50:11 +0900 (Tue, 05 Feb 2019) New Revision: 67009 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67009 Log: 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. Modified files: trunk/spec/ruby/library/socket/socket/udp_server_recv_spec.rb Index: spec/ruby/library/socket/socket/udp_server_recv_spec.rb =================================================================== --- spec/ruby/library/socket/socket/udp_server_recv_spec.rb (revision 67008) +++ spec/ruby/library/socket/socket/udp_server_recv_spec.rb (revision 67009) @@ -15,15 +15,15 @@ describe 'Socket.udp_server_recv' do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/socket/socket/udp_server_recv_spec.rb#L15 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/