about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-02-13 23:53:06 -0800
committerEric Wong <normalperson@yhbt.net>2009-02-14 00:32:23 -0800
commit82d76cd654dfed2d1c4233f9a77c3a901c510133 (patch)
tree9f1e9c9ec6cf3d743181d4951478d072d224f2c9 /test
parent92f412c8ead79524da5b823028dda14864f7f8ae (diff)
downloadunicorn-82d76cd654dfed2d1c4233f9a77c3a901c510133.tar.gz
This also fixes a subtle bug in header generation when the +$,+
($OFS) variable is defined to something other than nil or ""

I'm really wondering what kind of drugs I was on (or _not_ on)
when I modified some of this from the Mongrel source.
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_response.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/test_response.rb b/test/unit/test_response.rb
index 5d60594..c30a141 100644
--- a/test/unit/test_response.rb
+++ b/test/unit/test_response.rb
@@ -17,6 +17,17 @@ class ResponseTest < Test::Unit::TestCase
     assert out.length > 0, "output didn't have data"
   end
 
+  def test_response_OFS_set
+    old_ofs = $,
+    $, = "\f\v"
+    out = StringIO.new
+    HttpResponse.write(out,[200, {"X-Whatever" => "stuff"}, ["cool"]])
+    resp = out.read
+    assert ! resp.include?("\f\v"), "output didn't use $, ($OFS)"
+    ensure
+      $, = old_ofs
+  end
+
   def test_response_200
     io = StringIO.new
     HttpResponse.write(io, [200, {}, []])