diff options
author | ngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-08 04:03:53 +0000 |
---|---|---|
committer | ngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-08 04:03:53 +0000 |
commit | 14c46e5f1a4e2b905dcc17880fa40e09a4690b53 (patch) | |
tree | edfdd48da8eabae8eb8ad30be73bb2ce03f13890 /test | |
parent | be801955e95c259bf819c71dfc3d5f6102eb4ddf (diff) | |
download | ruby-14c46e5f1a4e2b905dcc17880fa40e09a4690b53.tar.gz |
* test/io/console/test_io_console.rb (test_getpass): s.getpass
should be tested. Narrow ensure block. This reverts r52911.
[Bug #11780] [ruby-dev:49412]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 |