From 7d463e360b9c4718b17378eb52783116a01b884b Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 11 Nov 2019 15:03:57 +0900 Subject: Merge RubyGems 3.1.0.pre3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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. --- test/rubygems/test_gem_specification.rb | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'test/rubygems/test_gem_specification.rb') diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index 3d166910c0..8f345f87a2 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -939,22 +939,24 @@ dependencies: [] assert_equal File.join(@tempdir, 'a-2.gemspec'), spec.loaded_from end - def test_self_load_tainted - full_path = @a2.spec_file - write_file full_path do |io| - io.write @a2.to_ruby_for_cache - end + if RUBY_VERSION < '2.7' + def test_self_load_tainted + full_path = @a2.spec_file + write_file full_path do |io| + io.write @a2.to_ruby_for_cache + end - full_path.taint - loader = Thread.new { $SAFE = 1; Gem::Specification.load full_path } - spec = loader.value + full_path.taint + loader = Thread.new { $SAFE = 1; Gem::Specification.load full_path } + spec = loader.value - @a2.files.clear + @a2.files.clear - assert_equal @a2, spec + assert_equal @a2, spec - ensure - $SAFE = 0 + ensure + $SAFE = 0 + end end def test_self_load_escape_curly @@ -1160,12 +1162,11 @@ dependencies: [] # Create gemspecs in three locations used in stubs loaded_spec = Gem::Specification.new 'a', '3' Gem.loaded_specs['a'] = loaded_spec - save_gemspec 'a', '2', dir_default_specs - save_gemspec 'a', '1', dir_standard_specs + save_gemspec('a-2', '2', dir_default_specs) { |s| s.name = 'a' } + save_gemspec('a-1', '1', dir_standard_specs) { |s| s.name = 'a' } full_names = ['a-3', 'a-2', 'a-1'] - full_names = Gem::Specification.stubs_for('a').map { |s| s.full_name } assert_equal full_names, Gem::Specification.stubs_for('a').map { |s| s.full_name } assert_equal 1, Gem::Specification.class_variable_get(:@@stubs_by_name).length @@ -2472,7 +2473,7 @@ Gem::Specification.new do |s| s.email = "example@example.com".freeze s.files = ["lib/code.rb".freeze] s.homepage = "http://example.com".freeze - s.rubygems_version = "3.1.0.pre2".freeze + s.rubygems_version = "#{Gem::VERSION}".freeze s.summary = "this is a summary".freeze end SPEC -- cgit v1.2.3