mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
OK, best fix is to set it to binmode.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@186 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
parent
4e7c657fc8
commit
3f3dab42df
1 changed files with 2 additions and 3 deletions
|
@ -47,7 +47,8 @@ class ResponseTest < Test::Unit::TestCase
|
|||
def test_response_file
|
||||
contents = "PLAIN TEXT\r\nCONTENTS\r\n"
|
||||
require 'tempfile'
|
||||
tmpf = open("test_response_file", "wb")
|
||||
tmpf = Tempfile.new("test_response_file")
|
||||
tmpf.binmode
|
||||
tmpf.write(contents)
|
||||
tmpf.rewind
|
||||
|
||||
|
@ -61,8 +62,6 @@ 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