diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-25 06:17:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-25 06:17:49 +0000 |
commit | 913943270ddeeed3e7436017bc5976070328f112 (patch) | |
tree | f487254f36975f86e1f2acf3a200662d27d18a03 /test/io | |
parent | 44e0cd19dfef7f1e5a01e5fc7c2f1bb06b7ea6c0 (diff) | |
download | ruby-913943270ddeeed3e7436017bc5976070328f112.tar.gz |
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
Diffstat (limited to 'test/io')
-rw-r--r-- | test/io/console/test_io_console.rb | 5 |
1 files changed, 3 insertions, 2 deletions
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 |