Project

General

Profile

Backport #3227 ┬╗ tempfile-unlink-tcase.rb

Testcase derived by rack-1.1.0 - Flameeyes (Diego Elio Petten├▓), 05/01/2010 04:59 AM

 
1
require 'tempfile'
2

    
3
tmp = Tempfile.new('RackRewindableInput')
4
tmp.chmod(0000)
5
tmp.set_encoding(Encoding::BINARY) if tmp.respond_to?(:set_encoding)
6
tmp.binmode
7

    
8
tmp.unlink
9
raise 'Unlink failed. IO closed.' if tmp.closed?