mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
a213c2ed9c
commit
e62c35fb8f
2 changed files with 15 additions and 7 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue