summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-09-26 12:36:31 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-09-26 12:36:31 +0200
commitdead7478748a828c45e16134fca812bc7771344e (patch)
tree33fe4a13dcf900795c90421a25ab7e554924b69a /test
parent4e31cbc07048fc57dbd16643a682df21db9a4342 (diff)
Use Tempfile.create instead of Tempfile.open in test_io.rb
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 7b1ddce78b..4bb8a1d1ff 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2737,7 +2737,7 @@ __END__
def test_flush_in_finalizer1
bug3910 = '[ruby-dev:42341]'
- tmp = Tempfile.open("bug3910") {|t|
+ Tempfile.create("bug3910") {|t|
path = t.path
t.close
fds = []
@@ -2757,12 +2757,11 @@ __END__
f.close
end
}
- tmp.close!
end
def test_flush_in_finalizer2
bug3910 = '[ruby-dev:42341]'
- Tempfile.open("bug3910") {|t|
+ Tempfile.create("bug3910") {|t|
path = t.path
t.close
begin
@@ -2781,7 +2780,6 @@ __END__
end
}
end
- t.close!
}
end
@@ -3400,10 +3398,17 @@ __END__
tempfiles = []
(0..fd_setsize+1).map {|i|
- tempfiles << Tempfile.open("test_io_select_with_many_files")
+ tempfiles << Tempfile.create("test_io_select_with_many_files")
}
- IO.select(tempfiles)
+ begin
+ IO.select(tempfiles)
+ ensure
+ tempfiles.each { |t|
+ t.close
+ File.unlink(t.path)
+ }
+ end
}, bug8080, timeout: 100
end if defined?(Process::RLIMIT_NOFILE)