mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@09fa86c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a641384815
commit
8180b5bfc0
54 changed files with 606 additions and 111 deletions
|
@ -53,42 +53,44 @@ describe 'Socket#connect_address' do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'using a socket bound to ::' do
|
||||
before do
|
||||
@sock = Socket.new(:INET6, :STREAM)
|
||||
@sock.bind(Socket.sockaddr_in(0, '::'))
|
||||
end
|
||||
guard -> { SocketSpecs.ipv6_available? } do
|
||||
describe 'using a socket bound to ::' do
|
||||
before do
|
||||
@sock = Socket.new(:INET6, :STREAM)
|
||||
@sock.bind(Socket.sockaddr_in(0, '::'))
|
||||
end
|
||||
|
||||
after do
|
||||
@sock.close
|
||||
end
|
||||
after do
|
||||
@sock.close
|
||||
end
|
||||
|
||||
it 'returns an Addrinfo' do
|
||||
@sock.connect_address.should be_an_instance_of(Addrinfo)
|
||||
end
|
||||
it 'returns an Addrinfo' do
|
||||
@sock.connect_address.should be_an_instance_of(Addrinfo)
|
||||
end
|
||||
|
||||
it 'uses ::1 as the IP address' do
|
||||
@sock.connect_address.ip_address.should == '::1'
|
||||
end
|
||||
it 'uses ::1 as the IP address' do
|
||||
@sock.connect_address.ip_address.should == '::1'
|
||||
end
|
||||
|
||||
it 'uses the correct port number' do
|
||||
@sock.connect_address.ip_port.should > 0
|
||||
end
|
||||
it 'uses the correct port number' do
|
||||
@sock.connect_address.ip_port.should > 0
|
||||
end
|
||||
|
||||
it 'uses AF_INET6 as the address family' do
|
||||
@sock.connect_address.afamily.should == Socket::AF_INET6
|
||||
end
|
||||
it 'uses AF_INET6 as the address family' do
|
||||
@sock.connect_address.afamily.should == Socket::AF_INET6
|
||||
end
|
||||
|
||||
it 'uses PF_INET6 as the address family' do
|
||||
@sock.connect_address.pfamily.should == Socket::PF_INET6
|
||||
end
|
||||
it 'uses PF_INET6 as the address family' do
|
||||
@sock.connect_address.pfamily.should == Socket::PF_INET6
|
||||
end
|
||||
|
||||
it 'uses SOCK_STREAM as the socket type' do
|
||||
@sock.connect_address.socktype.should == Socket::SOCK_STREAM
|
||||
end
|
||||
it 'uses SOCK_STREAM as the socket type' do
|
||||
@sock.connect_address.socktype.should == Socket::SOCK_STREAM
|
||||
end
|
||||
|
||||
it 'uses 0 as the protocol' do
|
||||
@sock.connect_address.protocol.should == 0
|
||||
it 'uses 0 as the protocol' do
|
||||
@sock.connect_address.protocol.should == 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue