aboutsummaryrefslogtreecommitdiffstats
path: root/test/io/console/test_io_console.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/io/console/test_io_console.rb')
-rw-r--r--test/io/console/test_io_console.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index c69eec757e..dc489166e8 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -180,6 +180,20 @@ 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))
+ }
+ ensure
+ th.join
+ end
+
def test_iflush
helper {|m, s|
m.print "a"