aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_io_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_io_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_io_m17n.rb')
-rw-r--r--test/ruby/test_io_m17n.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index a91fccee5f..ed8ac99946 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -1711,8 +1711,7 @@ EOT
args.each {|arg| f.print arg }
}
content = File.read("t", :mode=>"rb:ascii-8bit")
- assert_equal(expected.dup.force_encoding("ascii-8bit"),
- content.force_encoding("ascii-8bit"))
+ assert_equal(expected.b, content.b)
}
end
@@ -1892,7 +1891,7 @@ EOT
with_tmpdir {
src = "\u3042\r\n"
generate_file("t.txt", src)
- srcbin = src.dup.force_encoding("ascii-8bit")
+ srcbin = src.b
open("t.txt", "rt:utf-8:euc-jp") {|f|
f.binmode
result = f.read