mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Some people on windows have tmpfiles that are opened without rb.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@185 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
parent
7a8e36a8ca
commit
4e7c657fc8
1 changed files with 4 additions and 2 deletions
|
@ -47,7 +47,7 @@ class ResponseTest < Test::Unit::TestCase
|
|||
def test_response_file
|
||||
contents = "PLAIN TEXT\r\nCONTENTS\r\n"
|
||||
require 'tempfile'
|
||||
tmpf = Tempfile.new("test_response_file")
|
||||
tmpf = open("test_response_file", "wb")
|
||||
tmpf.write(contents)
|
||||
tmpf.rewind
|
||||
|
||||
|
@ -61,6 +61,8 @@ class ResponseTest < Test::Unit::TestCase
|
|||
io.rewind
|
||||
tmpf.close
|
||||
|
||||
File.unlink("test_response_file")
|
||||
|
||||
assert io.length > 0, "output didn't have data"
|
||||
assert io.read[-contents.length..-1] == contents, "output doesn't end with file payload"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue