Ease the Encoding::CompatibilityError test failure

At the time this test first started using `assert_raise_with_message`,
it did not touch `Encoding.default_internal`.
This commit is contained in:
Nobuyoshi Nakada 2023-07-30 15:13:58 +09:00
parent dfad14d83f
commit b5c74d5488
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -52,7 +52,8 @@ class TestRequire < Test::Unit::TestCase
def test_require_nonascii def test_require_nonascii
bug3758 = '[ruby-core:31915]' bug3758 = '[ruby-core:31915]'
["\u{221e}", "\x82\xa0".force_encoding("cp932")].each do |path| ["\u{221e}", "\x82\xa0".force_encoding("cp932")].each do |path|
assert_raise_with_message(LoadError, /#{path}\z/, bug3758) {require path} e = assert_raise(LoadError, bug3758) {require path}
assert_operator(e.message, :end_with?, path, bug3758)
end end
end end