Skip to content

Commit b8a7988

Browse files
committed
Avoid leaking fd in uminus_no_embed test
1 parent 65cfd5e commit b8a7988

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

test/ruby/test_string.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,9 +3443,11 @@ def test_uminus_no_freeze_not_bare
34433443

34443444
def test_uminus_no_embed_gc
34453445
pad = "a"*2048
3446-
("aa".."zz").each do |c|
3447-
fstr = -(c + pad).freeze
3448-
File.open(IO::NULL, "w").write(fstr)
3446+
File.open(IO::NULL, "w") do |dev_null|
3447+
("aa".."zz").each do |c|
3448+
fstr = -(c + pad).freeze
3449+
dev_null.write(fstr)
3450+
end
34493451
end
34503452
GC.start
34513453
end

0 commit comments

Comments
 (0)