license: use LGPLv2.1 or later (was LGPL (2.1|3.0)-only)
[raindrops.git] / test / test_inet_diag_socket.rb
blob047dff3f3f23fdf9faeb69d12562aeb3d3ac5fa1
1 # -*- encoding: binary -*-
2 require 'test/unit'
3 require 'raindrops'
4 require 'fcntl'
5 $stderr.sync = $stdout.sync = true
7 class TestInetDiagSocket < Test::Unit::TestCase
8   def test_new
9     sock = Raindrops::InetDiagSocket.new
10     assert_kind_of Socket, sock
11     assert_kind_of Fixnum, sock.fileno
12     flags = sock.fcntl(Fcntl::F_GETFD)
13     assert_equal Fcntl::FD_CLOEXEC, flags & Fcntl::FD_CLOEXEC
14     assert_nil sock.close
15   end
16 end if RUBY_PLATFORM =~ /linux/