mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
tests: support Linux kernels with CONFIG_IPV6=n
Detecting the presence of constants in C headers is insufficient, as a Linux kernel can be built with CONFIG_IPV6=n git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d7c806c079
commit
54ad3167e8
4 changed files with 29 additions and 21 deletions
|
@ -237,13 +237,15 @@ describe 'BasicSocket#setsockopt' do
|
|||
@socket.getsockopt(:IP, :TTL).int.should == 255
|
||||
end
|
||||
|
||||
it 'sets an IPv6 boolean option' do
|
||||
socket = Socket.new(:INET6, :STREAM)
|
||||
begin
|
||||
socket.setsockopt(:IPV6, :V6ONLY, true).should == 0
|
||||
socket.getsockopt(:IPV6, :V6ONLY).bool.should == true
|
||||
ensure
|
||||
socket.close
|
||||
guard -> { SocketSpecs.ipv6_available? } do
|
||||
it 'sets an IPv6 boolean option' do
|
||||
socket = Socket.new(:INET6, :STREAM)
|
||||
begin
|
||||
socket.setsockopt(:IPV6, :V6ONLY, true).should == 0
|
||||
socket.getsockopt(:IPV6, :V6ONLY).bool.should == true
|
||||
ensure
|
||||
socket.close
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue