aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-16 14:53:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-16 14:53:04 +0000
commit46530b894a2afd94b66b08d676119b05b5e0e5d0 (patch)
tree6710a4ba96bc190636d56fa9fb392da964175806
parent923e8d1cb1a6c6e8c05e045c31105fa0fa19eb45 (diff)
downloadruby-46530b894a2afd94b66b08d676119b05b5e0e5d0.tar.gz
test_process.rb: compare in UTF-8
* test/ruby/test_process.rb (test_execopts_open_chdir_m17n_path): compare directory name in UTF-8. encoding of `Dir.pwd` is affected by filesystem encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_process.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index cd45bde99d..95d32dbced 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -443,10 +443,11 @@ class TestProcess < Test::Unit::TestCase
def test_execopts_open_chdir_m17n_path
with_tmpchdir {|d|
Dir.mkdir "テスト"
- system(*PWD, :chdir => "テスト", :out => "open_chdir_テスト")
+ (pwd = PWD.dup).insert(1, '-EUTF-8:UTF-8')
+ system(*pwd, :chdir => "テスト", :out => "open_chdir_テスト")
assert_file.exist?("open_chdir_テスト")
assert_file.not_exist?("テスト/open_chdir_テスト")
- assert_equal("#{d}/テスト", File.read("open_chdir_テスト").chomp.encode(__ENCODING__))
+ assert_equal("#{d}/テスト", File.read("open_chdir_テスト", encoding: "UTF-8").chomp)
}
end if windows? || Encoding.find('locale') == Encoding::UTF_8