diff options
Diffstat (limited to 'spec/ruby/library')
-rw-r--r-- | spec/ruby/library/socket/socket/getnameinfo_spec.rb | 6 |
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 |