Fix Socket#socketpair on X19. #2014

Merged
merged 4 commits into from Nov 17, 2012
Commits on Nov 14, 2012
  1. Fix Socket#socketpair on X19.

    Francesco Rodriguez committed Nov 14, 2012
    Socket#socketpair `type` argument can accept
    a symbol that references to a `Socket::SOCK_*`
    constant.
    
        require 'socket'
    
        # Before
    
        Socket.socketpair(Socket::PF_UNIX, Socket::SOCK_DGRAM, 0)
        # => [#<Socket:fd 11>, #<Socket:fd 12>]
    
        Socket.socketpair(Socket::PF_UNIX, :DGRAM, 0)
        # => TypeError: Tried to use non-reference value 0x15a86 as type Bignum (10)
    
        # After
    
        Socket.socketpair(Socket::PF_UNIX, Socket::SOCK_DGRAM, 0)
        # => [#<Socket:fd 7>, #<Socket:fd 8>]
        Socket.socketpair(Socket::PF_UNIX, :DGRAM, 0)
        # => [#<Socket:fd 9>, #<Socket:fd 10>]
    
    Fixes #2011.
  2. Add specs for Socket#socketpair on X19

    Francesco Rodriguez committed Nov 14, 2012
Commits on Nov 16, 2012
  1. Add spec for Socket#socketpair on X18

    Francesco Rodriguez committed Nov 16, 2012