diff options
Diffstat (limited to 'test/io')
-rw-r--r-- | test/io/console/test_io_console.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 0e161b5c7a..74674ced9a 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -181,18 +181,18 @@ class TestIO_Console < Test::Unit::TestCase end def test_getpass - th = nil helper {|m, s| - th = Thread.start { - sleep 0.1 - s.print "asdf\n" - } - assert_equal("asdf", m.getpass) - assert_equal("\n", s.readpartial(2)) - th.join + begin + th = Thread.start { + sleep 0.1 + m.print "asdf\n" + } + assert_equal("asdf", s.getpass("> ")) + assert_equal("> \r\n", m.readpartial(10)) + ensure + th.join rescue nil + end } - ensure - th.join rescue nil end def test_iflush |