1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_io.rb (TestIO#test_autoclose): Tempfile.new doesn't

accept the block argument.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2011-12-26 04:21:15 +00:00
parent 48053fe615
commit bec52ad787
2 changed files with 25 additions and 23 deletions

View file

@ -1,3 +1,8 @@
Mon Dec 26 13:07:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_io.rb (TestIO#test_autoclose): Tempfile.new doesn't
accept the block argument.
Mon Dec 26 13:06:52 2011 Shota Fukumori <sorah@tubusu.net>
* lib/test/unit.rb: Avoid zombie processes on "--separate" option

View file

@ -1423,32 +1423,29 @@ class TestIO < Test::Unit::TestCase
feature2250 = '[ruby-core:26222]'
pre = 'ft2250'
Tempfile.new(pre) do |t|
f = IO.for_fd(t.fileno)
assert_equal(true, f.autoclose?)
f.autoclose = false
assert_equal(false, f.autoclose?)
f.close
assert_nothing_raised(Errno::EBADF) {t.close}
t = Tempfile.new(pre)
f = IO.for_fd(t.fileno)
assert_equal(true, f.autoclose?)
f.autoclose = false
assert_equal(false, f.autoclose?)
f.close
assert_nothing_raised(Errno::EBADF) {t.close}
t.open
f = IO.for_fd(t.fileno, autoclose: false)
assert_equal(false, f.autoclose?)
f.autoclose = true
assert_equal(true, f.autoclose?)
f.close
assert_raise(Errno::EBADF) {t.close}
end
t.open
f = IO.for_fd(t.fileno, autoclose: false)
assert_equal(false, f.autoclose?)
f.autoclose = true
assert_equal(true, f.autoclose?)
f.close
assert_raise(Errno::EBADF) {t.close}
Tempfile.new(pre) do |t|
try_fdopen(t.fileno)
assert_raise(Errno::EBADF) {t.close}
end
t = Tempfile.new(pre)
try_fdopen(t.fileno)
assert_raise(Errno::EBADF) {t.close}
Tempfile.new(pre) do |t|
try_fdopen(f.fileno, false)
assert_nothing_raised(Errno::EBADF) {t.close}
end
t = Tempfile.new(pre)
try_fdopen(t.fileno, false)
assert_nothing_raised(Errno::EBADF) {t.close}
end
def test_open_redirect