1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Specify external_encoding

http://c5664.rubyci.org/~chkbuild/ruby-trunk/log/20130329T090301Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2013-03-30 17:07:32 +00:00
parent ca76bb0877
commit c9d0a328ef

View file

@ -44,10 +44,10 @@ class TestArgf < Test::Unit::TestCase
t
end
def ruby(*args)
def ruby(*args, external_encoding: Encoding::UTF_8)
args = ['-e', '$>.write($<.read)'] if args.empty?
ruby = EnvUtil.rubybin
f = IO.popen([ruby] + args, 'r+')
f = IO.popen([ruby] + args, 'r+', external_encoding: external_encoding)
yield(f)
ensure
f.close unless !f || f.closed?
@ -247,8 +247,6 @@ class TestArgf < Test::Unit::TestCase
end
def test_inplace_stdin
t = make_tempfile
assert_in_out_err(["-", "-"], <<-INPUT, [], /Can't do inplace edit for stdio; skipping/)
ARGF.inplace_mode = '.bak'
f = ARGF.dup
@ -259,8 +257,6 @@ class TestArgf < Test::Unit::TestCase
end
def test_inplace_stdin2
t = make_tempfile
assert_in_out_err(["-"], <<-INPUT, [], /Can't do inplace edit for stdio/)
ARGF.inplace_mode = '.bak'
while line = ARGF.gets