From a1760485333d1061ec23385a6041388bf9e98068 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 14 Dec 2015 06:40:55 +0000 Subject: 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 --- test/ruby/test_io_m17n.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/ruby/test_io_m17n.rb') 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 -- cgit v1.2.3