diff --git a/test/test_response.rb b/test/test_response.rb index 8fb08320..99c07921 100644 --- a/test/test_response.rb +++ b/test/test_response.rb @@ -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 @@ -60,7 +60,9 @@ class ResponseTest < Test::Unit::TestCase end 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