diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-08 10:54:42 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-08 10:54:42 +0000 |
commit | 958e153cdbfffc09a485ce5fed6677b33170ea0f (patch) | |
tree | 15dd96cf0ae193616594bca85ead970323a129cc /test/io | |
parent | d9c6135c5bf540055ec76e27fef3f4a66057cf70 (diff) |
Revert r52902,r52903,r52910,r52911,r52937,r52939
Reject IO::Console#getpass because it can't test portablly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/io')
-rw-r--r-- | test/io/console/test_io_console.rb | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 980478fcbf..c69eec757e 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -180,28 +180,6 @@ class TestIO_Console < Test::Unit::TestCase } end - def test_getpass - # run_pty("p IO.console.getpass('> ')") do |r, w| - # assert_equal("> ", r.readpartial(10)) - # w.print "asdf\n" - # assert_equal("\r\n", r.gets) - # assert_equal("\"asdf\"", r.gets.chomp) - # end - helper {|m, s| - begin - th = Thread.start { - s.getpass("> ") - } - assert_equal("> ", m.readpartial(10)) - m.print "asdf\n" - assert_equal("asdf", th.value) - assert_equal("\r\n", m.gets) - ensure - th.join rescue nil - end - } - end - def test_iflush helper {|m, s| m.print "a" @@ -292,18 +270,17 @@ class TestIO_Console < Test::Unit::TestCase rescue RuntimeError skip $! else + result = [] + n.times {result << r.gets.chomp} + Process.wait(pid) if block_given? - yield r, w, pid + yield result else - result = [] - n.times {result << r.gets.chomp} - Process.wait(pid) result end ensure r.close if r w.close if w - Process.wait(pid) if pid end end if defined?(PTY) and defined?(IO::console) |