2003-12-04 21:54:48 -05:00
|
|
|
require 'test/unit'
|
|
|
|
require 'ut_eof'
|
|
|
|
|
|
|
|
class TestPipe < Test::Unit::TestCase
|
|
|
|
include TestEOF
|
|
|
|
def open_file(content)
|
2003-12-04 23:18:37 -05:00
|
|
|
r, w = IO.pipe
|
|
|
|
w << content
|
|
|
|
w.close
|
|
|
|
begin
|
|
|
|
yield r
|
|
|
|
ensure
|
|
|
|
r.close
|
|
|
|
end
|
2003-12-04 21:54:48 -05:00
|
|
|
end
|
|
|
|
end
|