summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-09 04:26:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-09 04:26:29 +0000
commite62c35fb8f7bc9fd9bc7e99a603da492fc89d21c (patch)
treeaae29b13a97f8b9e4b9d38111f36ea62cfb3eb11
parenta213c2ed9c84f0f64f0664e820227034d078f9f9 (diff)
* test/rubygems/test_gem_remote_fetcher.rb: skip OpenSSL dependent
tests if not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb17
2 files changed, 15 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index c88beb66e4d..bf46a3b1933 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed May 9 13:26:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/rubygems/test_gem_remote_fetcher.rb: skip OpenSSL dependent
+ tests if not available.
+
Wed May 9 08:09:38 2012 Ryan Davis <ryand-ruby@zenspider.com>
* lib/minitest/*: Imported minitest 3.0.0 (r7435)
diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb
index 30d49f61cb2..495c28727c0 100644
--- a/test/rubygems/test_gem_remote_fetcher.rb
+++ b/test/rubygems/test_gem_remote_fetcher.rb
@@ -1,7 +1,10 @@
require 'rubygems/test_case'
require 'ostruct'
require 'webrick'
-require 'webrick/https'
+begin
+ require 'webrick/https'
+rescue LoadError
+end
require 'rubygems/remote_fetcher'
require 'rubygems/format'
@@ -749,7 +752,7 @@ gems:
with_configured_fetcher(":ssl_ca_cert: #{temp_ca_cert}") do |fetcher|
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/yaml")
end
- end
+ end if defined?(OpenSSL::PKey)
def test_do_not_allow_insecure_ssl_connection_by_default
ssl_server = self.class.start_ssl_server
@@ -758,14 +761,14 @@ gems:
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/yaml")
end
end
- end
+ end if defined?(OpenSSL::PKey)
def test_ssl_connection_allow_verify_none
ssl_server = self.class.start_ssl_server
with_configured_fetcher(":ssl_verify_mode: 0") do |fetcher|
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/yaml")
end
- end
+ end if defined?(OpenSSL::PKey)
def test_do_not_follow_insecure_redirect
ssl_server = self.class.start_ssl_server
@@ -775,7 +778,7 @@ gems:
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/insecure_redirect?to=#{@server_uri}")
end
end
- end
+ end if defined?(OpenSSL::PKey)
def with_configured_fetcher(config_str = nil, &block)
if config_str
@@ -853,7 +856,7 @@ gems:
end
DIR = File.expand_path(File.dirname(__FILE__))
- DH_PARAM = OpenSSL::PKey::DH.new(128)
+ DH_PARAM = defined?(OpenSSL::PKey) ? OpenSSL::PKey::DH.new(128) : nil
def start_ssl_server(config = {})
null_logger = NilLog.new
@@ -891,7 +894,7 @@ gems:
end
end
server
- end
+ end if DH_PARAM