diff options
author | Peter Zhu <[email protected]> | 2022-11-26 16:06:05 -0500 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2022-11-26 16:06:05 -0500 |
commit | de9e2a5ac7b4ef52a03b1b6a3b07708f11d8d11c (patch) | |
tree | 86f94e71600a11291334fe1a5d010b498c18cf8b | |
parent | 26794b95cf1763ddc9629d9eb64a820a116d2d62 (diff) |
[ruby/net-http] Fix test for Ruby head
The error raised for broken coderanges was changed in ruby/ruby@571d21f
and the test was fixed in that commit but not ported to this repo.
ruby/net-http@e6185dda26ea6db7a3515d4f47ab231f5f4ac902
-rw-r--r-- | test/net/http/test_httpheader.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/net/http/test_httpheader.rb b/test/net/http/test_httpheader.rb index fe43ff0405..69563168db 100644 --- a/test/net/http/test_httpheader.rb +++ b/test/net/http/test_httpheader.rb @@ -28,7 +28,11 @@ class HTTPHeaderTest < Test::Unit::TestCase assert_raise(NoMethodError){ @c.initialize_http_header("foo"=>[]) } assert_raise(ArgumentError){ @c.initialize_http_header("foo"=>"a\nb") } assert_raise(ArgumentError){ @c.initialize_http_header("foo"=>"a\rb") } - assert_raise(Encoding::CompatibilityError){ @c.initialize_http_header("foo"=>"a\xff") } + end + + def test_initialize_with_broken_coderange + error = RUBY_VERSION >= "3.2" ? Encoding::CompatibilityError : ArgumentError + assert_raise(error){ @c.initialize_http_header("foo"=>"a\xff") } end def test_initialize_with_symbol |