1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/webrick] Manually pick commit from upstream repo

Fix test when run with US-ASCII encoding

  f402aafb36
This commit is contained in:
Hiroshi SHIBATA 2020-09-24 21:41:11 +09:00
parent f64bea6d66
commit 588ac990ff
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -291,6 +291,13 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
end
def test_multibyte_char_in_path
if Encoding.default_external == Encoding.find('US-ASCII')
reset_encoding = true
verb = $VERBOSE
$VERBOSE = false
Encoding.default_external = Encoding.find('UTF-8')
end
c = "\u00a7"
begin
c = c.encode('filesystem')
@ -320,6 +327,11 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
}
end
end
ensure
if reset_encoding
Encoding.default_external = Encoding.find('US-ASCII')
$VERBOSE = verb
end
end
def test_script_disclosure