From 422cf1095fc44f8d4b422de6cc579d572f4594bf Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 6 Feb 2018 07:42:44 +0000 Subject: test_gem_util.rb: fix broken test * test/rubygems/test_gem_util.rb: no guarantee that tmpdir is always underneath the root directory at all. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rubygems/test_gem_util.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/rubygems/test_gem_util.rb b/test/rubygems/test_gem_util.rb index 80dbff4b9e..71a26c06ae 100644 --- a/test/rubygems/test_gem_util.rb +++ b/test/rubygems/test_gem_util.rb @@ -42,11 +42,8 @@ class TestGemUtil < Gem::TestCase assert_equal File.join(@tempdir, 'd'), paths[0] assert_equal @tempdir, paths[1] - # File.expand_path with macOS returns `/private` prefix. - if RUBY_PLATFORM !~ /darwin/ - assert_equal Dir.tmpdir, paths[2] - assert_equal '/', paths[3] - end + assert_equal File.realpath(Dir.tmpdir), paths[2] + assert_equal File.realpath("..", Dir.tmpdir), paths[3] ensure # restore default permissions, allow the directory to be removed FileUtils.chmod(0775, 'd/e') unless win_platform? -- cgit v1.2.3