README: update with extra disclaimer
[raindrops.git] / test / test_inet_diag_socket.rb
blobe310dff5b4a4774d7e3582b35d04c86d977ea19d
1 # -*- encoding: binary -*-
2 # frozen_string_literal: false
3 require 'test/unit'
4 require 'raindrops'
5 require 'fcntl'
6 $stderr.sync = $stdout.sync = true
8 class TestInetDiagSocket < Test::Unit::TestCase
9   def test_new
10     sock = Raindrops::InetDiagSocket.new
11     assert_kind_of Socket, sock
12     assert_kind_of Integer, sock.fileno
13     flags = sock.fcntl(Fcntl::F_GETFD)
14     assert_equal Fcntl::FD_CLOEXEC, flags & Fcntl::FD_CLOEXEC
15     assert_nil sock.close
16   end
17 end if RUBY_PLATFORM =~ /linux/