diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-03 16:19:40 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-03 16:19:40 +0000 |
commit | b53cf149ad8d7c46572e4567ca949b4f82ebb22c (patch) | |
tree | ee5032bcb38573dade8ba2c46acbcc0d5f3ddfe3 /spec/ruby/library/socket/addrinfo/protocol_spec.rb | |
parent | aeeaadaad08038217440c1e9e7c5ca126d7dc633 (diff) |
Update to ruby/spec@9be7c7e
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/library/socket/addrinfo/protocol_spec.rb')
-rw-r--r-- | spec/ruby/library/socket/addrinfo/protocol_spec.rb | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/spec/ruby/library/socket/addrinfo/protocol_spec.rb b/spec/ruby/library/socket/addrinfo/protocol_spec.rb index 72f4f93b5c..ea143fc4a8 100644 --- a/spec/ruby/library/socket/addrinfo/protocol_spec.rb +++ b/spec/ruby/library/socket/addrinfo/protocol_spec.rb @@ -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") |