1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/tempfile.rb (Remover#call): fixed wrong condition introduced at

r50682.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2015-05-30 09:05:50 +00:00
parent 5e3455597d
commit cc09968d71
3 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Sat May 30 18:05:02 2015 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/tempfile.rb (Remover#call): fixed wrong condition. introduced at
r50682.
Sat May 30 16:12:35 2015 Eric Wong <e@80x24.org> Sat May 30 16:12:35 2015 Eric Wong <e@80x24.org>
* ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile * ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile

View file

@ -251,7 +251,7 @@ class Tempfile < DelegateClass(File)
warn "removing #{@tmpfile.path}..." if $DEBUG warn "removing #{@tmpfile.path}..." if $DEBUG
@tmpfile.close if @tmpfile.closed? @tmpfile.close unless @tmpfile.closed?
begin begin
File.unlink(@tmpfile.path) File.unlink(@tmpfile.path)
rescue Errno::ENOENT rescue Errno::ENOENT

View file

@ -207,7 +207,7 @@ File.open(path, "w").close
assert_in_out_err('-rtempfile', <<-'EOS') do |(filename), (error)| assert_in_out_err('-rtempfile', <<-'EOS') do |(filename), (error)|
puts Tempfile.new('foo').path puts Tempfile.new('foo').path
EOS EOS
assert !File.exist?(filename) assert !File.exist?(filename), "tempfile must not be exist after GC."
assert_nil(error) assert_nil(error)
end end
end end