repo.or.cz
/
kgio.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
define RARRAY_PTR/RARRAY_LEN macros for Ruby 1.8.6
[kgio.git]
/
test
/
test_pipe_popen.rb
blob
bfd18be982609be89e06ae9ce95c880dd20dd68b
1
require 'test/unit'
2
require 'io/nonblock'
3
$-w = true
4
require 'kgio'
5
6
class TestPipePopen < Test::Unit::TestCase
7
def test_popen
8
io = Kgio::Pipe.popen("sleep 1 && echo HI")
9
assert_equal :wait_readable, io.kgio_tryread(2)
10
sleep 1.5
11
assert_equal "HI\n", io.kgio_read(3)
12
assert_nil io.kgio_read(5)
13
end
14
end