mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Remove needless closed?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cc77a81129
commit
c66303cdd0
1 changed files with 6 additions and 6 deletions
|
@ -55,9 +55,9 @@ class TestOpen3 < Test::Unit::TestCase
|
||||||
i.close
|
i.close
|
||||||
assert_equal("baz", o.read)
|
assert_equal("baz", o.read)
|
||||||
ensure
|
ensure
|
||||||
i.close if !i.closed?
|
i.close
|
||||||
o.close if !o.closed?
|
o.close
|
||||||
e.close if !e.closed?
|
e.close
|
||||||
t.join
|
t.join
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -104,8 +104,8 @@ class TestOpen3 < Test::Unit::TestCase
|
||||||
r, w = IO.pipe
|
r, w = IO.pipe
|
||||||
yield r, w
|
yield r, w
|
||||||
ensure
|
ensure
|
||||||
r.close if !r.closed?
|
r.close
|
||||||
w.close if !w.closed?
|
w.close
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_reopen(io, arg)
|
def with_reopen(io, arg)
|
||||||
|
@ -114,7 +114,7 @@ class TestOpen3 < Test::Unit::TestCase
|
||||||
yield old
|
yield old
|
||||||
ensure
|
ensure
|
||||||
io.reopen(old)
|
io.reopen(old)
|
||||||
old.close if old && !old.closed?
|
old.close
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_popen2
|
def test_popen2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue