[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:
parent
e06bebff5e
commit
28d6c6d69b
@ -15,7 +15,7 @@ require "rubygems/request"
|
|||||||
# The tested hosts are explained in detail here: https://github.com/rubygems/rubygems/commit/5e16a5428f973667cabfa07e94ff939e7a83ebd9
|
# 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
|
def bundled_certificate_store
|
||||||
store = OpenSSL::X509::Store.new
|
store = OpenSSL::X509::Store.new
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ require_relative "helper"
|
|||||||
require "rubygems"
|
require "rubygems"
|
||||||
require "shellwords"
|
require "shellwords"
|
||||||
|
|
||||||
class TestConfig < Gem::TestCase
|
class TestGemConfig < Gem::TestCase
|
||||||
def test_datadir
|
def test_datadir
|
||||||
util_make_gems
|
util_make_gems
|
||||||
spec = Gem::Specification.find_by_name("a")
|
spec = Gem::Specification.find_by_name("a")
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
require_relative "helper"
|
require_relative "helper"
|
||||||
require "rubygems/deprecate"
|
require "rubygems/deprecate"
|
||||||
|
|
||||||
class TestDeprecate < Gem::TestCase
|
class TestGemDeprecate < Gem::TestCase
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
require_relative "helper"
|
require_relative "helper"
|
||||||
require "rubygems"
|
require "rubygems"
|
||||||
|
|
||||||
class TestExit < Gem::TestCase
|
class TestGemExit < Gem::TestCase
|
||||||
def test_exit
|
def test_exit
|
||||||
system(*ruby_with_rubygems_in_load_path, "-e", "raise Gem::SystemExitException.new(2)")
|
system(*ruby_with_rubygems_in_load_path, "-e", "raise Gem::SystemExitException.new(2)")
|
||||||
assert_equal 2, $?.exitstatus
|
assert_equal 2, $?.exitstatus
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require_relative "helper"
|
require_relative "helper"
|
||||||
|
|
||||||
class TestKernel < Gem::TestCase
|
class TestGemKernel < Gem::TestCase
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
require_relative "helper"
|
require_relative "helper"
|
||||||
require "open3"
|
require "open3"
|
||||||
|
|
||||||
class TestProjectSanity < Gem::TestCase
|
class TestGemProjectSanity < Gem::TestCase
|
||||||
def setup
|
def setup
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require_relative "helper"
|
require_relative "helper"
|
||||||
|
|
||||||
class TestRemoteFetchError < Gem::TestCase
|
class TestGemRemoteFetchError < Gem::TestCase
|
||||||
def test_password_redacted
|
def test_password_redacted
|
||||||
error = Gem::RemoteFetcher::FetchError.new("There was an error fetching", "https://user:secret@gemsource.org")
|
error = Gem::RemoteFetcher::FetchError.new("There was an error fetching", "https://user:secret@gemsource.org")
|
||||||
refute_match %r{secret}, error.to_s
|
refute_match %r{secret}, error.to_s
|
||||||
|
@ -168,7 +168,7 @@ end
|
|||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
#
|
#
|
||||||
# HTTPResponseFactory.create(
|
# Gem::HTTPResponseFactory.create(
|
||||||
# body: "",
|
# body: "",
|
||||||
# code: 301,
|
# code: 301,
|
||||||
# msg: "Moved Permanently",
|
# msg: "Moved Permanently",
|
||||||
@ -176,7 +176,7 @@ end
|
|||||||
# )
|
# )
|
||||||
#
|
#
|
||||||
|
|
||||||
class HTTPResponseFactory
|
class Gem::HTTPResponseFactory
|
||||||
def self.create(body:, code:, msg:, headers: {})
|
def self.create(body:, code:, msg:, headers: {})
|
||||||
response = Net::HTTPResponse.send(:response_class, code.to_s).new("1.0", code.to_s, msg)
|
response = Net::HTTPResponse.send(:response_class, code.to_s).new("1.0", code.to_s, msg)
|
||||||
response.instance_variable_set(:@body, body)
|
response.instance_variable_set(:@body, body)
|
||||||
@ -374,7 +374,7 @@ end
|
|||||||
#
|
#
|
||||||
# This class was added to flush out problems in Rubinius' IO implementation.
|
# 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+.
|
# Creates a new TempIO that will be initialized to contain +string+.
|
||||||
|
|
||||||
@ -393,3 +393,8 @@ class TempIO < Tempfile
|
|||||||
Gem.read_binary path
|
Gem.read_binary path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class Gem::TestCase
|
||||||
|
TempIO = Gem::TempIO
|
||||||
|
HTTPResponseFactory = Gem::HTTPResponseFactory
|
||||||
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user