diff options
Diffstat (limited to 'test/unit/test_response.rb')
-rw-r--r-- | test/unit/test_response.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/test_response.rb b/test/unit/test_response.rb index 66c2b54..f9eda8e 100644 --- a/test/unit/test_response.rb +++ b/test/unit/test_response.rb @@ -1,3 +1,5 @@ +# -*- encoding: binary -*- + # Copyright (c) 2005 Zed A. Shaw # You can redistribute it and/or modify it under the same terms as Ruby. # @@ -94,4 +96,15 @@ class ResponseTest < Test::Unit::TestCase assert_match(expect_body, out.string.split(/\r\n/).last) end + def test_unknown_status_pass_through + out = StringIO.new + HttpResponse.write(out,["666 I AM THE BEAST", {}, [] ]) + assert out.closed? + headers = out.string.split(/\r\n\r\n/).first.split(/\r\n/) + assert %r{\AHTTP/\d\.\d 666 I AM THE BEAST\z}.match(headers[0]) + status = headers.grep(/\AStatus:/i).first + assert status + assert_equal "Status: 666 I AM THE BEAST", status + end + end |