diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-24 21:41:11 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-24 21:41:11 +0900 |
commit | 588ac990ff170e2fb62e7ba0ed52a8088189cdbd (patch) | |
tree | b092826fe756cb95b7abed15b1801f69299dbdd6 /test | |
parent | f64bea6d66335daf799c2223b7f4bc0d099424cb (diff) |
[ruby/webrick] Manually pick commit from upstream repo
Fix test when run with US-ASCII encoding
https://github.com/ruby/webrick/commit/f402aafb36bbd43be54621405da550643a1a1a4c
Diffstat (limited to 'test')
-rw-r--r-- | test/webrick/test_filehandler.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb index 9674c176cf..998e03f690 100644 --- a/test/webrick/test_filehandler.rb +++ b/test/webrick/test_filehandler.rb @@ -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 |