mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@9be7c7e
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
aeeaadaad0
commit
b53cf149ad
246 changed files with 9108 additions and 548 deletions
|
@ -1,30 +1,16 @@
|
|||
require_relative '../../../spec_helper'
|
||||
require 'socket'
|
||||
require_relative '../spec_helper'
|
||||
|
||||
describe "Addrinfo#protocol" do
|
||||
describe "for an ipv4 socket" do
|
||||
|
||||
before :each do
|
||||
@addrinfo = Addrinfo.tcp("127.0.0.1", 80)
|
||||
end
|
||||
|
||||
it "returns Socket::IPPROTO_TCP" do
|
||||
@addrinfo.protocol.should == Socket::IPPROTO_TCP
|
||||
end
|
||||
|
||||
it 'returns 0 by default' do
|
||||
Addrinfo.ip('127.0.0.1').protocol.should == 0
|
||||
end
|
||||
|
||||
describe "for an ipv6 socket" do
|
||||
before :each do
|
||||
@addrinfo = Addrinfo.tcp("::1", 80)
|
||||
end
|
||||
|
||||
it "returns Socket::IPPROTO_TCP" do
|
||||
@addrinfo.protocol.should == Socket::IPPROTO_TCP
|
||||
end
|
||||
it 'returns a custom protocol when given' do
|
||||
Addrinfo.tcp('127.0.0.1', 80).protocol.should == Socket::IPPROTO_TCP
|
||||
Addrinfo.tcp('::1', 80).protocol.should == Socket::IPPROTO_TCP
|
||||
end
|
||||
|
||||
platform_is_not :windows do
|
||||
with_feature :unix_socket do
|
||||
describe "for a unix socket" do
|
||||
before :each do
|
||||
@addrinfo = Addrinfo.unix("/tmp/sock")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue