diff --git a/ChangeLog b/ChangeLog index 207630eb36..6794634f3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Nov 24 20:02:40 2011 Tanaka Akira + + * test/openssl/test_engine.rb: use IO#reopen to restore stderr. + Thu Nov 24 19:59:56 2011 Tanaka Akira * io.c (rb_io_reopen): re-initialize buffereing mode for stdout and diff --git a/test/openssl/test_engine.rb b/test/openssl/test_engine.rb index f56fbe757c..a6b2cf0a17 100644 --- a/test/openssl/test_engine.rb +++ b/test/openssl/test_engine.rb @@ -53,7 +53,10 @@ class OpenSSL::TestEngine < Test::Unit::TestCase assert_equal(data, decrypted) cleanup ensure - $stderr = err_back if err_back + if err_back + $stderr.reopen(err_back) + err_back.close + end end private diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index af161eae26..8899994897 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2157,4 +2157,13 @@ End } } end + + def test_std_fileno + assert_equal(0, STDIN.fileno) + assert_equal(1, STDOUT.fileno) + assert_equal(2, STDERR.fileno) + assert_equal(0, $stdin.fileno) + assert_equal(1, $stdout.fileno) + assert_equal(2, $stderr.fileno) + end end