summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-23 00:20:49 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-23 00:20:49 +0000
commitae19a18996727954cba2da90ab816e2d5023822a (patch)
tree158b316a17cb6618235df3ce4cf27c6108240084 /test
parent9b9fe826fd1ce825af3503f39643f75910307a51 (diff)
Merge RubyGems 3.0.1 from rubygems/rubygems.
It fixed the issues of RubyGems 3.0.0. https://blog.rubygems.org/2018/12/23/3.0.1-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/test_gem.rb2
-rw-r--r--test/rubygems/test_gem_util.rb17
2 files changed, 18 insertions, 1 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index e062eebbaa..b65787470c 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -198,7 +198,7 @@ class TestGem < Gem::TestCase
end
assert_equal(expected, result)
ensure
- File.chmod(0700, *Dir.glob(@gemhome+'/gems/**/').map {|path| path.untaint})
+ File.chmod(0755, *Dir.glob(@gemhome+'/gems/**/').map {|path| path.untaint})
end
def test_require_missing
diff --git a/test/rubygems/test_gem_util.rb b/test/rubygems/test_gem_util.rb
index 0fd8441d26..88afc62976 100644
--- a/test/rubygems/test_gem_util.rb
+++ b/test/rubygems/test_gem_util.rb
@@ -58,4 +58,21 @@ class TestGemUtil < Gem::TestCase
assert_equal 4, list.find { |x| x == 4 }
end
+ def test_glob_files_in_dir
+ FileUtils.mkdir_p 'g'
+ FileUtils.touch File.join('g', 'h.rb')
+ FileUtils.touch File.join('g', 'i.rb')
+
+ expected_paths = [
+ File.join(@tempdir, 'g/h.rb'),
+ File.join(@tempdir, 'g/i.rb'),
+ ]
+
+ files_with_absolute_base = Gem::Util.glob_files_in_dir('*.rb', File.join(@tempdir, 'g'))
+ assert_equal expected_paths.to_set, files_with_absolute_base.to_set
+
+ files_with_relative_base = Gem::Util.glob_files_in_dir('*.rb', 'g')
+ assert_equal expected_paths.to_set, files_with_relative_base.to_set
+ end
+
end