ruby-changes:62461
From: David <ko1@a...>
Date: Fri, 31 Jul 2020 21:08:28 +0900 (JST)
Subject: [ruby-changes:62461] e1494145d9 (master): [rubygems/rubygems] Make sure tests at least load without openssl
https://git.ruby-lang.org/ruby.git/commit/?id=e1494145d9 From e1494145d9725dba217fbc2bd9645db011fab946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Mon, 29 Jun 2020 18:42:29 +0200 Subject: [rubygems/rubygems] Make sure tests at least load without openssl https://github.com/rubygems/rubygems/commit/054d57f74b diff --git a/lib/rubygems/s3_uri_signer.rb b/lib/rubygems/s3_uri_signer.rb index 1ea9ff0..c0b8884 100644 --- a/lib/rubygems/s3_uri_signer.rb +++ b/lib/rubygems/s3_uri_signer.rb @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/s3_uri_signer.rb#L1 require 'base64' require 'digest' -require 'openssl' +require 'rubygems/openssl' ## # S3URISigner implements AWS SigV4 for S3 Source to avoid a dependency on the aws-sdk-* gems diff --git a/test/rubygems/test_bundled_ca.rb b/test/rubygems/test_bundled_ca.rb index 61f70fd..b30264a 100644 --- a/test/rubygems/test_bundled_ca.rb +++ b/test/rubygems/test_bundled_ca.rb @@ -1,6 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_bundled_ca.rb#L1 # frozen_string_literal: true require 'rubygems/test_case' require 'net/http' +require 'rubygems/openssl' + +unless defined?(OpenSSL::SSL) + warn 'Skipping bundled certificates tests. openssl not found.' +end + require 'rubygems/request' # = Testing Bundled CA @@ -52,4 +58,4 @@ class TestBundledCA < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_bundled_ca.rb#L58 def test_accessing_new_index assert_https('fastly.rubygems.org') end -end +end if defined?(OpenSSL::SSL) diff --git a/test/rubygems/test_gem_dependency_installer.rb b/test/rubygems/test_gem_dependency_installer.rb index 7912e00..803b95e 100644 --- a/test/rubygems/test_gem_dependency_installer.rb +++ b/test/rubygems/test_gem_dependency_installer.rb @@ -840,6 +840,8 @@ class TestGemDependencyInstaller < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_dependency_installer.rb#L840 assert_equal %w[a-1-cpu-other_platform-1], inst.installed_gems.map {|s| s.full_name } end + require 'rubygems/openssl' + if defined? OpenSSL def test_install_security_policy util_setup_gems diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index b99d12a..f635be8 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -2431,6 +2431,9 @@ end https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_specification.rb#L2431 end def test_to_ruby_with_rsa_key + require 'rubygems/openssl' + skip 'openssl is missing' unless defined?(OpenSSL::PKey::RSA) + rsa_key = OpenSSL::PKey::RSA.new(2048) @a2.signing_key = rsa_key ruby_code = @a2.to_ruby -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/