diff options
author | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-09 04:09:25 +0000 |
---|---|---|
committer | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-09 04:09:25 +0000 |
commit | a213c2ed9c84f0f64f0664e820227034d078f9f9 (patch) | |
tree | dbc503f2118fdb51f0c45ebf36ead1b799286468 /test/rubygems | |
parent | 2dece928e085d25e8326455b9c0f508a2d70d02d (diff) | |
download | ruby-a213c2ed9c84f0f64f0664e820227034d078f9f9.tar.gz |
Imported minitest 3.0.0 (r7435) w/ fixes for rubygems. 10955 tests, 2253343 assertions, 1 failures, 1 errors, 28 skips minus drb tests on x86_64-darwin11.3.0 and reviewed by drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems')
-rw-r--r-- | test/rubygems/test_gem_platform.rb | 77 | ||||
-rw-r--r-- | test/rubygems/test_gem_remote_fetcher.rb | 17 |
2 files changed, 49 insertions, 45 deletions
diff --git a/test/rubygems/test_gem_platform.rb b/test/rubygems/test_gem_platform.rb index f3b94ea83d..0350d5f028 100644 --- a/test/rubygems/test_gem_platform.rb +++ b/test/rubygems/test_gem_platform.rb @@ -207,64 +207,71 @@ class TestGemPlatform < Gem::TestCase def test_equals_tilde util_set_arch 'i386-mswin32' - assert_match 'mswin32', Gem::Platform.local - assert_match 'i386-mswin32', Gem::Platform.local + assert_local_match 'mswin32' + assert_local_match 'i386-mswin32' # oddballs - assert_match 'i386-mswin32-mq5.3', Gem::Platform.local - assert_match 'i386-mswin32-mq6', Gem::Platform.local - refute_match 'win32-1.8.2-VC7', Gem::Platform.local - refute_match 'win32-1.8.4-VC6', Gem::Platform.local - refute_match 'win32-source', Gem::Platform.local - refute_match 'windows', Gem::Platform.local + assert_local_match 'i386-mswin32-mq5.3' + assert_local_match 'i386-mswin32-mq6' + refute_local_match 'win32-1.8.2-VC7' + refute_local_match 'win32-1.8.4-VC6' + refute_local_match 'win32-source' + refute_local_match 'windows' util_set_arch 'i686-linux' - assert_match 'i486-linux', Gem::Platform.local - assert_match 'i586-linux', Gem::Platform.local - assert_match 'i686-linux', Gem::Platform.local + assert_local_match 'i486-linux' + assert_local_match 'i586-linux' + assert_local_match 'i686-linux' util_set_arch 'i686-darwin8' - assert_match 'i686-darwin8.4.1', Gem::Platform.local - assert_match 'i686-darwin8.8.2', Gem::Platform.local + assert_local_match 'i686-darwin8.4.1' + assert_local_match 'i686-darwin8.8.2' util_set_arch 'java' - assert_match 'java', Gem::Platform.local - assert_match 'jruby', Gem::Platform.local + assert_local_match 'java' + assert_local_match 'jruby' util_set_arch 'universal-dotnet2.0' - assert_match 'universal-dotnet', Gem::Platform.local - assert_match 'universal-dotnet-2.0', Gem::Platform.local - refute_match 'universal-dotnet-4.0', Gem::Platform.local - assert_match 'dotnet', Gem::Platform.local - assert_match 'dotnet-2.0', Gem::Platform.local - refute_match 'dotnet-4.0', Gem::Platform.local + assert_local_match 'universal-dotnet' + assert_local_match 'universal-dotnet-2.0' + refute_local_match 'universal-dotnet-4.0' + assert_local_match 'dotnet' + assert_local_match 'dotnet-2.0' + refute_local_match 'dotnet-4.0' util_set_arch 'universal-dotnet4.0' - assert_match 'universal-dotnet', Gem::Platform.local - refute_match 'universal-dotnet-2.0', Gem::Platform.local - assert_match 'universal-dotnet-4.0', Gem::Platform.local - assert_match 'dotnet', Gem::Platform.local - refute_match 'dotnet-2.0', Gem::Platform.local - assert_match 'dotnet-4.0', Gem::Platform.local + assert_local_match 'universal-dotnet' + refute_local_match 'universal-dotnet-2.0' + assert_local_match 'universal-dotnet-4.0' + assert_local_match 'dotnet' + refute_local_match 'dotnet-2.0' + assert_local_match 'dotnet-4.0' util_set_arch 'universal-macruby-1.0' - assert_match 'universal-macruby', Gem::Platform.local - assert_match 'macruby', Gem::Platform.local - refute_match 'universal-macruby-0.10', Gem::Platform.local - assert_match 'universal-macruby-1.0', Gem::Platform.local + assert_local_match 'universal-macruby' + assert_local_match 'macruby' + refute_local_match 'universal-macruby-0.10' + assert_local_match 'universal-macruby-1.0' util_set_arch 'powerpc-darwin' - assert_match 'powerpc-darwin', Gem::Platform.local + assert_local_match 'powerpc-darwin' util_set_arch 'powerpc-darwin7' - assert_match 'powerpc-darwin7.9.0', Gem::Platform.local + assert_local_match 'powerpc-darwin7.9.0' util_set_arch 'powerpc-darwin8' - assert_match 'powerpc-darwin8.10.0', Gem::Platform.local + assert_local_match 'powerpc-darwin8.10.0' util_set_arch 'sparc-solaris2.8' - assert_match 'sparc-solaris2.8-mq5.3', Gem::Platform.local + assert_local_match 'sparc-solaris2.8-mq5.3' end + def assert_local_match name + assert_match Gem::Platform.local, name + end + + def refute_local_match name + refute_match Gem::Platform.local, name + end end diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb index 495c28727c..30d49f61cb 100644 --- a/test/rubygems/test_gem_remote_fetcher.rb +++ b/test/rubygems/test_gem_remote_fetcher.rb @@ -1,10 +1,7 @@ require 'rubygems/test_case' require 'ostruct' require 'webrick' -begin - require 'webrick/https' -rescue LoadError -end +require 'webrick/https' require 'rubygems/remote_fetcher' require 'rubygems/format' @@ -752,7 +749,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 if defined?(OpenSSL::PKey) + end def test_do_not_allow_insecure_ssl_connection_by_default ssl_server = self.class.start_ssl_server @@ -761,14 +758,14 @@ gems: fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/yaml") end end - end if defined?(OpenSSL::PKey) + end 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 if defined?(OpenSSL::PKey) + end def test_do_not_follow_insecure_redirect ssl_server = self.class.start_ssl_server @@ -778,7 +775,7 @@ gems: fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/insecure_redirect?to=#{@server_uri}") end end - end if defined?(OpenSSL::PKey) + end def with_configured_fetcher(config_str = nil, &block) if config_str @@ -856,7 +853,7 @@ gems: end DIR = File.expand_path(File.dirname(__FILE__)) - DH_PARAM = defined?(OpenSSL::PKey) ? OpenSSL::PKey::DH.new(128) : nil + DH_PARAM = OpenSSL::PKey::DH.new(128) def start_ssl_server(config = {}) null_logger = NilLog.new @@ -894,7 +891,7 @@ gems: end end server - end if DH_PARAM + end |