Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add specs for Socket#socketpair on X19

  • Loading branch information...
commit b66bb353da8ff8edc6c0f384ad2bc75c5f7cbc4c 1 parent 66c4dca
@frodsan frodsan authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 spec/ruby/library/socket/shared/socketpair.rb
View
12 spec/ruby/library/socket/shared/socketpair.rb
@@ -8,4 +8,16 @@
s2.close
end
end
+
+ ruby_version_is "1.9" do
+ it "raises SocketError if given symbol is not a Socket constants reference" do
+ lambda { Socket.socketpair(Socket::AF_UNIX, :NO_EXIST, 0) }.should raise_error(SocketError)
+ end
+
+ it "not raises SocketError if given symbol references a Socket constant" do
+ [ :DGRAM, :RAW, :RDM, :SEQPACKET, :STREAM ].each do |socket_type|
+ lambda { Socket.socketpair(Socket::AF_UNIX, socket_type, 0) }.should_not raise_error(SocketError)
+ end
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.