[ruby/open-uri] Close leaked files
https://github.com/ruby/open-uri/commit/c52ee9e430
This commit is contained in:
parent
7e0d2c6143
commit
fbe7962b54
@ -173,9 +173,12 @@ class TestOpenURI < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_pass_keywords
|
def test_pass_keywords
|
||||||
require 'tempfile'
|
begin
|
||||||
t = Tempfile.new
|
f = URI.open(File::NULL, mode: 0666)
|
||||||
assert_kind_of File, URI.open(Tempfile.new.path, mode: 0666)
|
assert_kind_of File, f
|
||||||
|
ensure
|
||||||
|
f&.close
|
||||||
|
end
|
||||||
|
|
||||||
o = Object.new
|
o = Object.new
|
||||||
def o.open(foo: ) foo end
|
def o.open(foo: ) foo end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user