Skip to content

Commit c52ee9e

Browse files
committed
Close leaked files
1 parent f636d01 commit c52ee9e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/open-uri/test_open-uri.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,12 @@ def test_invalid_option
173173
end
174174

175175
def test_pass_keywords
176-
require 'tempfile'
177-
t = Tempfile.new
178-
assert_kind_of File, URI.open(Tempfile.new.path, mode: 0666)
176+
begin
177+
f = URI.open(File::NULL, mode: 0666)
178+
assert_kind_of File, f
179+
ensure
180+
f&.close
181+
end
179182

180183
o = Object.new
181184
def o.open(foo: ) foo end

0 commit comments

Comments
 (0)