[rubygems/rubygems] add some test suites under the Gem namespace, so as not to collide

To avoid collisions especially in ruby/ruby

https://github.com/rubygems/rubygems/commit/e6b2359975
This commit is contained in:
lukeg 2023-03-20 14:01:40 -04:00 коммит произвёл Hiroshi SHIBATA
Родитель e06bebff5e
Коммит 28d6c6d69b
8 изменённых файлов: 15 добавлений и 10 удалений

Просмотреть файл

@ -15,7 +15,7 @@ require "rubygems/request"
# The tested hosts are explained in detail here: https://github.com/rubygems/rubygems/commit/5e16a5428f973667cabfa07e94ff939e7a83ebd9
#
class TestBundledCA < Gem::TestCase
class TestGemBundledCA < Gem::TestCase
def bundled_certificate_store
store = OpenSSL::X509::Store.new

Просмотреть файл

@ -4,7 +4,7 @@ require_relative "helper"
require "rubygems"
require "shellwords"
class TestConfig < Gem::TestCase
class TestGemConfig < Gem::TestCase
def test_datadir
util_make_gems
spec = Gem::Specification.find_by_name("a")

Просмотреть файл

@ -3,7 +3,7 @@
require_relative "helper"
require "rubygems/deprecate"
class TestDeprecate < Gem::TestCase
class TestGemDeprecate < Gem::TestCase
def setup
super

Просмотреть файл

@ -3,7 +3,7 @@
require_relative "helper"
require "rubygems"
class TestExit < Gem::TestCase
class TestGemExit < Gem::TestCase
def test_exit
system(*ruby_with_rubygems_in_load_path, "-e", "raise Gem::SystemExitException.new(2)")
assert_equal 2, $?.exitstatus

Просмотреть файл

@ -2,7 +2,7 @@
require_relative "helper"
class TestKernel < Gem::TestCase
class TestGemKernel < Gem::TestCase
def setup
super

Просмотреть файл

@ -3,7 +3,7 @@
require_relative "helper"
require "open3"
class TestProjectSanity < Gem::TestCase
class TestGemProjectSanity < Gem::TestCase
def setup
end

Просмотреть файл

@ -2,7 +2,7 @@
require_relative "helper"
class TestRemoteFetchError < Gem::TestCase
class TestGemRemoteFetchError < Gem::TestCase
def test_password_redacted
error = Gem::RemoteFetcher::FetchError.new("There was an error fetching", "https://user:secret@gemsource.org")
refute_match %r{secret}, error.to_s

Просмотреть файл

@ -168,7 +168,7 @@ end
#
# Example:
#
# HTTPResponseFactory.create(
# Gem::HTTPResponseFactory.create(
# body: "",
# code: 301,
# msg: "Moved Permanently",
@ -176,7 +176,7 @@ end
# )
#
class HTTPResponseFactory
class Gem::HTTPResponseFactory
def self.create(body:, code:, msg:, headers: {})
response = Net::HTTPResponse.send(:response_class, code.to_s).new("1.0", code.to_s, msg)
response.instance_variable_set(:@body, body)
@ -374,7 +374,7 @@ end
#
# This class was added to flush out problems in Rubinius' IO implementation.
class TempIO < Tempfile
class Gem::TempIO < Tempfile
##
# Creates a new TempIO that will be initialized to contain +string+.
@ -393,3 +393,8 @@ class TempIO < Tempfile
Gem.read_binary path
end
end
class Gem::TestCase
TempIO = Gem::TempIO
HTTPResponseFactory = Gem::HTTPResponseFactory
end