diff options
Diffstat (limited to 'test/rubygems/test_gem_util.rb')
-rw-r--r-- | test/rubygems/test_gem_util.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/test/rubygems/test_gem_util.rb b/test/rubygems/test_gem_util.rb index 04cb000f8d..608210a903 100644 --- a/test/rubygems/test_gem_util.rb +++ b/test/rubygems/test_gem_util.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative "helper" require "rubygems/util" @@ -35,12 +36,12 @@ class TestGemUtil < Gem::TestCase end def test_traverse_parents_does_not_crash_on_permissions_error - pend "skipped on MS Windows (chmod has no effect)" if win_platform? || java_platform? + pend "skipped on MS Windows (chmod has no effect)" if Gem.win_platform? || Gem.java_platform? FileUtils.mkdir_p "d/e/f" # remove 'execute' permission from "e" directory and make it # impossible to cd into it and its children - FileUtils.chmod(0666, "d/e") + FileUtils.chmod(0o666, "d/e") pend "skipped in root privilege" if Process.uid.zero? @@ -52,15 +53,7 @@ class TestGemUtil < Gem::TestCase assert_equal File.realpath("../..", @tempdir), paths[3] ensure # restore default permissions, allow the directory to be removed - FileUtils.chmod(0775, "d/e") unless win_platform? || java_platform? - end - - def test_linked_list_find - list = [1,2,3,4,5].inject(Gem::List.new(0)) do |m,o| - Gem::List.new o, m - end - assert_equal 5, list.find {|x| x == 5 } - assert_equal 4, list.find {|x| x == 4 } + FileUtils.chmod(0o775, "d/e") unless Gem.win_platform? || Gem.java_platform? end def test_glob_files_in_dir |