summaryrefslogtreecommitdiff
path: root/test/ruby/test_m17n.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r--test/ruby/test_m17n.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 3a45f1f..8e7e4c6 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1673,13 +1673,9 @@ class TestM17N < Test::Unit::TestCase
def test_inspect_with_default_internal
bug11787 = '[ruby-dev:49415] [Bug #11787]'
- orig_int = Encoding.default_internal
- Encoding.default_internal = ::Encoding::EUC_JP
- s = begin
- [e("\xB4\xC1\xBB\xFA")].inspect
- ensure
- Encoding.default_internal = orig_int
- end
+ s = EnvUtil.with_default_internal(::Encoding::EUC_JP) do
+ [e("\xB4\xC1\xBB\xFA")].inspect
+ end
assert_equal(e("[\"\xB4\xC1\xBB\xFA\"]"), s, bug11787)
end
end