summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 17cfd28bf8..f4b65f7f36 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1003,6 +1003,8 @@ class TestIO < Test::Unit::TestCase
assert_raise(SecurityError) do
safe_4 { r.inspect }
end
+ r.freeze
+ assert_match(/^#<IO:fd \d+>$/, r.inspect)
end
end
@@ -2556,6 +2558,21 @@ End
assert_equal(2, $stderr.fileno)
end
+ def test_frozen_fileno
+ bug9865 = '[ruby-dev:48241] [Bug #9865]'
+ with_pipe do |r,w|
+ fd = r.fileno
+ assert_equal(fd, r.freeze.fileno, bug9865)
+ end
+ end
+
+ def test_frozen_autoclose
+ with_pipe do |r,w|
+ fd = r.fileno
+ assert_equal(true, r.freeze.autoclose?)
+ end
+ end
+
def test_sysread_locktmp
bug6099 = '[ruby-dev:45297]'
buf = " " * 100