summaryrefslogtreecommitdiff
path: root/spec/ruby
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-18 19:35:37 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-18 19:35:37 +0000
commit3405ea62b5989281a4ddfa4f64db9e6a8624a500 (patch)
tree4cf9c0c9da39412f4afd909e509397712473e495 /spec/ruby
parent7b37c8cdc539d32fc077f5f1620d21265ae70431 (diff)
Accept TypeError for Socket#getnameinfo
* Happens when VALIDATE_SOCKLEN() actually checks the length such as on FreeBSD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby')
-rw-r--r--spec/ruby/library/socket/socket/getnameinfo_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/ruby/library/socket/socket/getnameinfo_spec.rb b/spec/ruby/library/socket/socket/getnameinfo_spec.rb
index 394a90cb47..d5511ad499 100644
--- a/spec/ruby/library/socket/socket/getnameinfo_spec.rb
+++ b/spec/ruby/library/socket/socket/getnameinfo_spec.rb
@@ -68,8 +68,10 @@ describe 'Socket.getnameinfo' do
@addr = Socket.sockaddr_in(80, '127.0.0.1')
end
- it 'raises SocketError when using an invalid String' do
- lambda { Socket.getnameinfo('cats') }.should raise_error(SocketError)
+ it 'raises SocketError or TypeError when using an invalid String' do
+ lambda { Socket.getnameinfo('cats') }.should raise_error(Exception) { |e|
+ [SocketError, TypeError].should include(e.class)
+ }
end
describe 'without custom flags' do