* 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
This commit is contained in:
nobu 2014-12-25 06:17:49 +00:00
Родитель 44e0cd19df
Коммит 913943270d
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -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