aboutsummaryrefslogtreecommitdiffstats
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
commita1760485333d1061ec23385a6041388bf9e98068 (patch)
tree91fad68f293185c4ac2ee01e568b91896ae04bb9 /test/ruby/test_m17n.rb
parentc9d0b0f9f6e93bcf27f2ca0d74ed5518250b78a5 (diff)
downloadruby-a1760485333d1061ec23385a6041388bf9e98068.tar.gz
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