summaryrefslogtreecommitdiff
path: root/test/io/console/test_io_console.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-25 06:17:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-25 06:17:49 +0000
commit913943270ddeeed3e7436017bc5976070328f112 (patch)
treef487254f36975f86e1f2acf3a200662d27d18a03 /test/io/console/test_io_console.rb
parent44e0cd19dfef7f1e5a01e5fc7c2f1bb06b7ea6c0 (diff)
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/console/test_io_console.rb')
-rw-r--r--test/io/console/test_io_console.rb5
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