[前][次][番号順一覧][スレッド一覧]

ruby-changes:50128

From: nobu <ko1@a...>
Date: Tue, 6 Feb 2018 16:42:50 +0900 (JST)
Subject: [ruby-changes:50128] nobu:r62246 (trunk): test_gem_util.rb: fix broken test

nobu	2018-02-06 16:42:44 +0900 (Tue, 06 Feb 2018)

  New Revision: 62246

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62246

  Log:
    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.

  Modified files:
    trunk/test/rubygems/test_gem_util.rb
Index: test/rubygems/test_gem_util.rb
===================================================================
--- test/rubygems/test_gem_util.rb	(revision 62245)
+++ test/rubygems/test_gem_util.rb	(revision 62246)
@@ -42,11 +42,8 @@ class TestGemUtil < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_util.rb#L42
 
     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?

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]