Sha256: 170228e14f502e372b630de127578c37eb849f302cadab20e3a07f0aedf3b82c

Contents?: true

Size: 535 Bytes

Versions: 17

Compression:

Stored size: 535 Bytes

Contents

require 'test/unit'
$-w = true
require 'kgio'

class TestSingletonReadWrite < Test::Unit::TestCase

  def test_unix_socketpair
    a, b = UNIXSocket.pair
    Kgio.trywrite(a, "HELLO")
    buf = ""
    assert_equal "HELLO", Kgio.tryread(b, 5, buf)
    assert_equal "HELLO", buf
    assert_equal :wait_readable, Kgio.tryread(b, 5)
  end

  def test_arg_error
    assert_raises(ArgumentError) { Kgio.tryread }
    assert_raises(ArgumentError) { Kgio.tryread($stdin) }
    assert_raises(ArgumentError) { Kgio.trywrite($stdout) }
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
kgio-2.11.4 test/test_singleton_read_write.rb
kgio-2.11.3 test/test_singleton_read_write.rb
kgio-2.11.2 test/test_singleton_read_write.rb
kgio-2.11.1.1.g36ea test/test_singleton_read_write.rb
kgio-2.11.1 test/test_singleton_read_write.rb
kgio-2.11.0 test/test_singleton_read_write.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/kgio-2.10.0/test/test_singleton_read_write.rb
kgio-2.10.0 test/test_singleton_read_write.rb
kgio-2.9.3 test/test_singleton_read_write.rb
kgio-2.9.2 test/test_singleton_read_write.rb
kgio-2.9.1 test/test_singleton_read_write.rb
kgio-2.9.0.2.gf33a test/test_singleton_read_write.rb
kgio-2.9.0 test/test_singleton_read_write.rb
kgio-2.8.1 test/test_singleton_read_write.rb
kgio-2.8.0.2.g30c1 test/test_singleton_read_write.rb
kgio-2.8.0 test/test_singleton_read_write.rb
kgio-2.7.4 test/test_singleton_read_write.rb