aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_tempfile.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-19 09:20:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-19 09:20:14 +0000
commitdc516c5235149f056aa2809a2c1609aaf4cfa84f (patch)
treefbfd86cb5a5bbbafafef9394ae3844d0cfb9c1d9 /test/test_tempfile.rb
parent541c59cd25ccd70cece01237b88efb8e78964da5 (diff)
downloadruby-dc516c5235149f056aa2809a2c1609aaf4cfa84f.tar.gz
tempfile.rb: remove in Tempfile.create
* lib/tempfile.rb (Tempfile.create): should not fail even if the temporary file has been removed in the block, just ignore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_tempfile.rb')
-rw-r--r--test/test_tempfile.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb
index a2b272747e..92ec988f63 100644
--- a/test/test_tempfile.rb
+++ b/test/test_tempfile.rb
@@ -343,6 +343,12 @@ puts Tempfile.new('foo').path
assert_file.exist?(path)
}
assert_file.not_exist?(path)
+
+ Tempfile.create("tempfile-create") {|f|
+ path = f.path
+ File.unlink(f.path)
+ }
+ assert_file.not_exist?(path)
end
def test_create_without_block