Project

General

Profile

Feature #11715 ยป tempfile.patch

ksss (Yuki Kurihara), 11/19/2015 02:12 PM

View differences:

lib/tempfile.rb
yield tmpfile
ensure
tmpfile.close if !tmpfile.closed?
File.unlink tmpfile
begin
File.unlink tmpfile
rescue Errno::ENOENT
end
end
else
tmpfile
test/test_tempfile.rb
assert(!File.exist?(path))
end
def test_create_with_unlink_in_block_silently_fails
assert_nothing_raised {
Tempfile.create("tempfile-create") {|f|
f.close
File.unlink f.path
}
}
end
def test_create_without_block
path = nil
f = Tempfile.create("tempfile-create")
    (1-1/1)