aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-11-11 15:03:57 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2019-11-11 16:59:49 +0900
commit7d463e360b9c4718b17378eb52783116a01b884b (patch)
treeee6951d298d76fcbf0c5e062712e54de56a3fa39 /test/rubygems/test_gem.rb
parent31416423809f64d4b5ea6b9651cced3179cc5ced (diff)
downloadruby-7d463e360b9c4718b17378eb52783116a01b884b.tar.gz
Merge RubyGems 3.1.0.pre3
* Fix gem pristine not accounting for user installed gems. Pull request #2914 by Luis Sagastume. * Refactor keyword argument test for Ruby 2.7. Pull request #2947 by SHIBATA Hiroshi. * Fix errors at frozen Gem::Version. Pull request #2949 by Nobuyoshi Nakada. * Remove taint usage on Ruby 2.7+. Pull request #2951 by Jeremy Evans. * Check Manifest.txt is up to date. Pull request #2953 by David Rodríguez. * Clarify symlink conditionals in tests. Pull request #2962 by David Rodríguez. * Update command line parsing to work under ps. Pull request #2966 by David Rodríguez. * Properly test `Gem::Specifications.stub_for`. Pull request #2970 by David Rodríguez. * Fix Gem::LOADED_SPECS_MUTEX handling for recursive locking. Pull request #2985 by MSP-Greg.
Diffstat (limited to 'test/rubygems/test_gem.rb')
-rw-r--r--test/rubygems/test_gem.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index 23f8249e34..859aba6588 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -14,14 +14,14 @@ end
# TODO: push this up to test_case.rb once battle tested
$LOAD_PATH.map! do |path|
- path.dup.untaint
+ path.dup.tap(&Gem::UNTAINT)
end
class TestGem < Gem::TestCase
PLUGINS_LOADED = [] # rubocop:disable Style/MutableConstant
- PROJECT_DIR = File.expand_path('../../..', __FILE__).untaint
+ PROJECT_DIR = File.expand_path('../../..', __FILE__).tap(&Gem::UNTAINT)
def setup
super
@@ -220,7 +220,7 @@ class TestGem < Gem::TestCase
end
assert_equal(expected, result)
ensure
- File.chmod(0755, *Dir.glob(@gemhome + '/gems/**/').map {|path| path.untaint})
+ File.chmod(0755, *Dir.glob(@gemhome + '/gems/**/').map {|path| path.tap(&Gem::UNTAINT)})
end
def test_require_missing
@@ -1617,8 +1617,8 @@ class TestGem < Gem::TestCase
assert_equal expected_specs, Gem.use_gemdeps.sort_by { |s| s.name }
end
- LIB_PATH = File.expand_path "../../../lib".dup.untaint, __FILE__.dup.untaint
- BUNDLER_LIB_PATH = File.expand_path $LOAD_PATH.find {|lp| File.file?(File.join(lp, "bundler.rb")) }.dup.untaint
+ LIB_PATH = File.expand_path "../../../lib".dup.tap(&Gem::UNTAINT), __FILE__.dup.tap(&Gem::UNTAINT)
+ BUNDLER_LIB_PATH = File.expand_path $LOAD_PATH.find {|lp| File.file?(File.join(lp, "bundler.rb")) }.dup.tap(&Gem::UNTAINT)
BUNDLER_FULL_NAME = "bundler-#{Bundler::VERSION}".freeze
def add_bundler_full_name(names)
@@ -1645,8 +1645,8 @@ class TestGem < Gem::TestCase
ENV['RUBYGEMS_GEMDEPS'] = "-"
path = File.join @tempdir, "gem.deps.rb"
- cmd = [Gem.ruby.dup.untaint, "-I#{LIB_PATH.untaint}",
- "-I#{BUNDLER_LIB_PATH.untaint}", "-rrubygems"]
+ cmd = [Gem.ruby.dup.tap(&Gem::UNTAINT), "-I#{LIB_PATH.tap(&Gem::UNTAINT)}",
+ "-I#{BUNDLER_LIB_PATH.tap(&Gem::UNTAINT)}", "-rrubygems"]
cmd << "-eputs Gem.loaded_specs.values.map(&:full_name).sort"
File.open path, "w" do |f|
@@ -1683,8 +1683,8 @@ class TestGem < Gem::TestCase
Dir.mkdir "sub1"
path = File.join @tempdir, "gem.deps.rb"
- cmd = [Gem.ruby.dup.untaint, "-Csub1", "-I#{LIB_PATH.untaint}",
- "-I#{BUNDLER_LIB_PATH.untaint}", "-rrubygems"]
+ cmd = [Gem.ruby.dup.tap(&Gem::UNTAINT), "-Csub1", "-I#{LIB_PATH.tap(&Gem::UNTAINT)}",
+ "-I#{BUNDLER_LIB_PATH.tap(&Gem::UNTAINT)}", "-rrubygems"]
cmd << "-eputs Gem.loaded_specs.values.map(&:full_name).sort"
File.open path, "w" do |f|
@@ -1732,7 +1732,7 @@ class TestGem < Gem::TestCase
end
def test_use_gemdeps
- gem_deps_file = 'gem.deps.rb'.untaint
+ gem_deps_file = 'gem.deps.rb'.tap(&Gem::UNTAINT)
spec = util_spec 'a', 1
install_specs spec