mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 13:34:17 +02:00
Merge rubygems master.
This is RC version of Rubygems 2.7.0.
688fb7e83c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6b05153a3a
commit
c00e84327f
96 changed files with 2021 additions and 701 deletions
|
@ -1,3 +1,4 @@
|
|||
|
||||
# frozen_string_literal: true
|
||||
require 'rubygems/test_case'
|
||||
require 'rubygems/commands/build_command'
|
||||
|
@ -117,5 +118,30 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|||
util_test_build_gem @gem, gemspec_file, false
|
||||
end
|
||||
|
||||
end
|
||||
CERT_FILE = cert_path 'public3072'
|
||||
SIGNING_KEY = key_path 'private3072'
|
||||
|
||||
def test_build_signed_gem
|
||||
trust_dir = Gem::Security.trust_dir
|
||||
|
||||
spec = util_spec 'some_gem' do |s|
|
||||
s.signing_key = SIGNING_KEY
|
||||
s.cert_chain = [CERT_FILE]
|
||||
end
|
||||
|
||||
gemspec_file = File.join(@tempdir, spec.spec_name)
|
||||
|
||||
File.open gemspec_file, 'w' do |gs|
|
||||
gs.write spec.to_ruby
|
||||
end
|
||||
|
||||
util_test_build_gem spec, gemspec_file
|
||||
|
||||
trust_dir.trust_cert OpenSSL::X509::Certificate.new(File.read(CERT_FILE))
|
||||
|
||||
gem = Gem::Package.new(File.join(@tempdir, spec.file_name),
|
||||
Gem::Security::HighSecurity)
|
||||
assert gem.verify
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue