about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-04-23 21:20:03 -0700
committerEric Wong <normalperson@yhbt.net>2009-04-23 21:20:03 -0700
commit5facf207004a805d0b0836a6605bb02ab5ac77da (patch)
treefc85ce61c9aa545381a61ba9f003ff91bc9d3e02 /test
parenta9fa99940cd6d6f8572f83d6489d402c09b0cf93 (diff)
downloadunicorn-5facf207004a805d0b0836a6605bb02ab5ac77da.tar.gz
Avoid creating garbage every time we lookup the status code
along with the message.  Also, we can use global const arrays
for a little extra performance because we only write one-at-a
time

Looking at MRI 1.8, Array#join with an empty string argument is
slightly better because it skips an append for every iteration.
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_response.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/unit/test_response.rb b/test/unit/test_response.rb
index 1d47c57..3cb0a41 100644
--- a/test/unit/test_response.rb
+++ b/test/unit/test_response.rb
@@ -43,7 +43,7 @@ class ResponseTest < Test::Unit::TestCase
     HttpResponse.write(io, [code, {}, []])
     assert io.closed?
     lines = io.string.split(/\r\n/)
-    assert_match(/.* #{HTTP_STATUS_CODES[code]}$/, lines.first,
+    assert_match(/.* Bad Request$/, lines.first,
                  "wrong default reason phrase")
   end