From 945e4692ca9898c0595ef30437ec3a45b75483a4 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 25 Dec 2014 07:14:12 +0000 Subject: console.c: IO.console arguments passing * ext/io/console/console.c (console_dev): send the given arguments to the opened console. as a special case, do nothing if :close is given. * test/lib/leakchecker.rb (LeakChecker#check_fd_leak): close if console. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/io/console/test_io_console.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/io/console/test_io_console.rb') diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 237a41a35f..3481a2b213 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -222,14 +222,22 @@ class TestIO_Console < Test::Unit::TestCase IO.console.close assert_kind_of(IO, IO.console) assert_nothing_raised(IOError) {IO.console.fileno} + + IO.console(:close) + assert(IO.console(:tty?)) + ensure + IO.console(:close) end def test_sync assert(IO.console.sync, "console should be unbuffered") + ensure + IO.console(:close) end else def test_close assert_equal(["true"], run_pty("IO.console.close; p IO.console.fileno >= 0")) + assert_equal(["true"], run_pty("IO.console(:close); p IO.console(:tty?)")) end def test_sync -- cgit v1.2.3