raindrops.git  about / heads / tags
real-time stats for preforking Rack servers
blob e310dff5b4a4774d7e3582b35d04c86d977ea19d 491 bytes (raw)
$ git show HEAD:test/test_inet_diag_socket.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 
# -*- encoding: binary -*-
# frozen_string_literal: false
require 'test/unit'
require 'raindrops'
require 'fcntl'
$stderr.sync = $stdout.sync = true

class TestInetDiagSocket < Test::Unit::TestCase
  def test_new
    sock = Raindrops::InetDiagSocket.new
    assert_kind_of Socket, sock
    assert_kind_of Integer, sock.fileno
    flags = sock.fcntl(Fcntl::F_GETFD)
    assert_equal Fcntl::FD_CLOEXEC, flags & Fcntl::FD_CLOEXEC
    assert_nil sock.close
  end
end if RUBY_PLATFORM =~ /linux/

git clone https://yhbt.net/raindrops.git