зеркало из https://github.com/github/ruby.git
[ruby/open-uri] Close leaked files
https://github.com/ruby/open-uri/commit/c52ee9e430
This commit is contained in:
Родитель
7e0d2c6143
Коммит
fbe7962b54
|
@ -173,9 +173,12 @@ class TestOpenURI < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_pass_keywords
|
||||
require 'tempfile'
|
||||
t = Tempfile.new
|
||||
assert_kind_of File, URI.open(Tempfile.new.path, mode: 0666)
|
||||
begin
|
||||
f = URI.open(File::NULL, mode: 0666)
|
||||
assert_kind_of File, f
|
||||
ensure
|
||||
f&.close
|
||||
end
|
||||
|
||||
o = Object.new
|
||||
def o.open(foo: ) foo end
|
||||
|
|
Загрузка…
Ссылка в новой задаче