From e4664efaf8c29b7f670157266d2d3551fdde6776 Mon Sep 17 00:00:00 2001 From: kazu Date: Wed, 4 Jul 2018 12:45:46 +0000 Subject: [PATCH] Skip more rubygems tests when openssl is missing Some tests are already skipped, but some tests are not. So latter should be skipped too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rubygems/test_gem_commands_build_command.rb | 2 ++ test/rubygems/test_gem_install_update_options.rb | 2 ++ test/rubygems/test_gem_remote_fetcher.rb | 6 +++++- test/rubygems/test_gem_request.rb | 7 +++++-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb index 6d31949187..19ca03bb70 100644 --- a/test/rubygems/test_gem_commands_build_command.rb +++ b/test/rubygems/test_gem_commands_build_command.rb @@ -154,6 +154,8 @@ class TestGemCommandsBuildCommand < Gem::TestCase SIGNING_KEY = key_path 'private3072' def test_build_signed_gem + skip 'openssl is missing' unless defined?(OpenSSL::SSL) + trust_dir = Gem::Security.trust_dir spec = util_spec 'some_gem' do |s| diff --git a/test/rubygems/test_gem_install_update_options.rb b/test/rubygems/test_gem_install_update_options.rb index 371e408d27..2a85a279a4 100644 --- a/test/rubygems/test_gem_install_update_options.rb +++ b/test/rubygems/test_gem_install_update_options.rb @@ -119,6 +119,8 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase end def test_security_policy_unknown + skip 'openssl is missing' unless defined?(OpenSSL::SSL) + @cmd.add_install_update_options e = assert_raises OptionParser::InvalidArgument do diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb index 884d26a3c7..1eed0c7670 100644 --- a/test/rubygems/test_gem_remote_fetcher.rb +++ b/test/rubygems/test_gem_remote_fetcher.rb @@ -9,6 +9,10 @@ rescue LoadError => e e.message =~ / -- openssl$/ end +unless defined?(OpenSSL::SSL) then + warn 'Skipping Gem::Request tests. openssl not found.' +end + require 'rubygems/remote_fetcher' require 'rubygems/package' require 'minitest/mock' @@ -1067,4 +1071,4 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== assert_equal "/home/skillet", @fetcher.correct_for_windows_path(path) end -end +end if defined?(OpenSSL::SSL) diff --git a/test/rubygems/test_gem_request.rb b/test/rubygems/test_gem_request.rb index 46a49a6943..d816e91f62 100644 --- a/test/rubygems/test_gem_request.rb +++ b/test/rubygems/test_gem_request.rb @@ -4,6 +4,10 @@ require 'rubygems/request' require 'ostruct' require 'base64' +unless defined?(OpenSSL::SSL) then + warn 'Skipping Gem::Request tests. openssl not found.' +end + class TestGemRequest < Gem::TestCase CA_CERT_FILE = cert_path 'ca' @@ -491,5 +495,4 @@ ERROR: Certificate is an invalid CA certificate end end -end - +end if defined?(OpenSSL::SSL)