summaryrefslogtreecommitdiff
path: root/test/ruby/test_m17n.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-14 06:40:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-14 06:40:55 +0000
commitc81b224edca453ed8ea3030cc74b2ede5ac9e63a (patch)
tree91fad68f293185c4ac2ee01e568b91896ae04bb9 /test/ruby/test_m17n.rb
parentfcb4ab8d1c917b3f2a998f9b6eab3d9cec27670a (diff)
test: use String#b instead of dup.force_encoding
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r--test/ruby/test_m17n.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 4efe18187b..a9cb86a5c8 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -8,7 +8,7 @@ class TestM17N < Test::Unit::TestCase
module AESU
def ua(str) str.dup.force_encoding("US-ASCII") end
- def a(str) str.dup.force_encoding("ASCII-8BIT") end
+ def a(str) str.b end
def e(str) str.dup.force_encoding("EUC-JP") end
def s(str) str.dup.force_encoding("Windows-31J") end
def u(str) str.dup.force_encoding("UTF-8") end
@@ -1130,7 +1130,7 @@ class TestM17N < Test::Unit::TestCase
def test_dup_scan
s1 = e("\xa4\xa2")*100
- s2 = s1.dup.force_encoding("ascii-8bit")
+ s2 = s1.b
s2.scan(/\A./n) {|f|
assert_equal(Encoding::ASCII_8BIT, f.encoding)
}
@@ -1138,7 +1138,7 @@ class TestM17N < Test::Unit::TestCase
def test_dup_aref
s1 = e("\xa4\xa2")*100
- s2 = s1.dup.force_encoding("ascii-8bit")
+ s2 = s1.b
assert_equal(Encoding::ASCII_8BIT, s2[10..-1].encoding)
end