summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-03 04:39:50 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-03 04:39:50 +0000
commit47264c4e1ffbc34fdd83b8bada241990433d9ee3 (patch)
tree142f528e554bc695fbe0f9f432c7ee8e7811abee /test
parent0187f76a676cb545106e6d5d6fdb8f2d060261a4 (diff)
merge revision(s) 46151,46165: [Backport #9865]
* io.c (rb_io_fileno, rb_io_inspect): non-modification does not error on frozen IO. [ruby-dev:48241] [Bug #9865] * io.c (rb_io_autoclose_p): Don't raise on frozen IO. * test/lib/minitest/unit.rb: IO#autoclose? may raise IOError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@47368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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