Sha256: 16fc594b5665a75f975f3f3ddf4facd1c94aff22c97a048782e9dfe8d9784a5a
Contents?: true
Size: 866 Bytes
Versions: 9
Compression:
Stored size: 866 Bytes
Contents
# Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) require_relative 'helper' require 'timeout' class TestStreamFile < Testcase ENV["N"].to_i > 1 and parallelize_me! DevFD = Struct.new(:to_path) def test_stream_file fp = File.open("COPYING") sf = Yahns::StreamFile.new(fp, true, 0, fp.stat.size) refute sf.respond_to?(:close) sf.wbuf_close(nil) assert fp.closed? end def test_fd fp = File.open("COPYING") obj = DevFD.new("/dev/fd/#{fp.fileno}") sf = Yahns::StreamFile.new(obj, true, 0, fp.stat.size) io = sf.instance_variable_get :@tmpio assert_instance_of IO, io.to_io assert_equal fp.fileno, io.fileno refute sf.respond_to?(:close) sf.wbuf_close(nil) refute fp.closed? refute io.closed? end end
Version data entries
9 entries across 9 versions & 1 rubygems