summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_specification.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_specification.rb
parent31416423809f64d4b5ea6b9651cced3179cc5ced (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2666
Diffstat (limited to 'test/rubygems/test_gem_specification.rb')
-rw-r--r--test/rubygems/test_gem_specification.rb33
1 files changed, 17 insertions, 16 deletions
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