diff options
author | Benoit Daloze <[email protected]> | 2023-10-30 13:49:46 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2023-10-30 13:49:46 +0100 |
commit | ab4781b64d945e962575f2eac20b72185235d23b (patch) | |
tree | 9c4456926c1616b0417db0b389371d578876a136 /spec/ruby/library/socket/udpsocket | |
parent | 14fa5e39d72c84d3e12e10dc5d77a6e6200c10f5 (diff) |
Update to ruby/spec@bd7017f
Diffstat (limited to 'spec/ruby/library/socket/udpsocket')
-rw-r--r-- | spec/ruby/library/socket/udpsocket/new_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/library/socket/udpsocket/new_spec.rb b/spec/ruby/library/socket/udpsocket/new_spec.rb index 6cc0cadbcb..79bfcb624d 100644 --- a/spec/ruby/library/socket/udpsocket/new_spec.rb +++ b/spec/ruby/library/socket/udpsocket/new_spec.rb @@ -26,6 +26,12 @@ describe 'UDPSocket.new' do @socket.should be_an_instance_of(UDPSocket) end + it "does not use the given block and warns to use UDPSocket::open" do + -> { + @socket = UDPSocket.new { raise } + }.should complain(/warning: UDPSocket::new\(\) does not take block; use UDPSocket::open\(\) instead/) + end + it 'raises Errno::EAFNOSUPPORT or Errno::EPROTONOSUPPORT if unsupported family passed' do -> { UDPSocket.new(-1) }.should raise_error(SystemCallError) { |e| [Errno::EAFNOSUPPORT, Errno::EPROTONOSUPPORT].should include(e.class) |