From 913943270ddeeed3e7436017bc5976070328f112 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 25 Dec 2014 06:17:49 +0000 Subject: test_io_console.rb: use gets * test/io/console/test_io_console.rb (run_pty): pty cannot read all, should use gets only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/io/console/test_io_console.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/io') diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index b8a1cf95b5..237a41a35f 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -249,12 +249,13 @@ class TestIO_Console < Test::Unit::TestCase s.close if s end - def run_pty(src) + def run_pty(src, n = 1) r, w, pid = PTY.spawn(EnvUtil.rubybin, "-rio/console", "-e", src) rescue RuntimeError skip $! else - result = r.readlines.map(&:chomp) + result = [] + n.times {result << r.gets.chomp} Process.wait(pid) if block_given? yield result -- cgit v1.2.3