6 class TestTeeInput < Test::Unit::TestCase
12 @rd.sync = @wr.sync = true
17 return if $$ != @start_pid
29 ti = Unicorn::TeeInput.new(@rd, nil, "hello")
33 3.times { @wr.write("ffff" * 4096) }
38 assert_nothing_raised { line = ti.gets }
39 assert_equal(4096 * 4 * 3 + 5 + $/.size, line.size)
40 assert_equal("hello" << ("ffff" * 4096 * 3) << "#$/", line)
41 assert_nothing_raised { line = ti.gets }
42 assert_equal "foo#$/", line
44 assert_nothing_raised { pid, status = Process.waitpid2(pid) }
45 assert status.success?
49 ti = Unicorn::TeeInput.new(@rd, nil, "hello")
57 assert_nothing_raised { line = ti.gets }
58 assert_equal("hello#$/", line)
59 assert_nothing_raised { line = ti.gets }
60 assert_equal "foo", line
62 assert_nothing_raised { pid, status = Process.waitpid2(pid) }
63 assert status.success?