From 3f3dab42dfc8eb129cb6652e3a580490eeeef7eb Mon Sep 17 00:00:00 2001 From: zedshaw Date: Tue, 16 May 2006 05:06:22 +0000 Subject: [PATCH] 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 --- test/test_response.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/test_response.rb b/test/test_response.rb index 99c07921..2ebcdb00 100644 --- a/test/test_response.rb +++ b/test/test_response.rb @@ -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