Skip to content

Commit 28d6c6d

Browse files
luke-gruhsbt
authored andcommitted
[rubygems/rubygems] add some test suites under the Gem namespace, so as not to collide
To avoid collisions especially in ruby/ruby ruby/rubygems@e6b2359975
1 parent e06bebf commit 28d6c6d

File tree

8 files changed

+15
-10
lines changed

8 files changed

+15
-10
lines changed

test/rubygems/test_bundled_ca.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# The tested hosts are explained in detail here: https://github.com/rubygems/rubygems/commit/5e16a5428f973667cabfa07e94ff939e7a83ebd9
1616
#
1717

18-
class TestBundledCA < Gem::TestCase
18+
class TestGemBundledCA < Gem::TestCase
1919
def bundled_certificate_store
2020
store = OpenSSL::X509::Store.new
2121

test/rubygems/test_config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require "rubygems"
55
require "shellwords"
66

7-
class TestConfig < Gem::TestCase
7+
class TestGemConfig < Gem::TestCase
88
def test_datadir
99
util_make_gems
1010
spec = Gem::Specification.find_by_name("a")

test/rubygems/test_deprecate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require_relative "helper"
44
require "rubygems/deprecate"
55

6-
class TestDeprecate < Gem::TestCase
6+
class TestGemDeprecate < Gem::TestCase
77
def setup
88
super
99

test/rubygems/test_exit.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require_relative "helper"
44
require "rubygems"
55

6-
class TestExit < Gem::TestCase
6+
class TestGemExit < Gem::TestCase
77
def test_exit
88
system(*ruby_with_rubygems_in_load_path, "-e", "raise Gem::SystemExitException.new(2)")
99
assert_equal 2, $?.exitstatus

test/rubygems/test_kernel.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require_relative "helper"
44

5-
class TestKernel < Gem::TestCase
5+
class TestGemKernel < Gem::TestCase
66
def setup
77
super
88

test/rubygems/test_project_sanity.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require_relative "helper"
44
require "open3"
55

6-
class TestProjectSanity < Gem::TestCase
6+
class TestGemProjectSanity < Gem::TestCase
77
def setup
88
end
99

test/rubygems/test_remote_fetch_error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require_relative "helper"
44

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

test/rubygems/utilities.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,15 @@ def download_to_cache(dependency)
168168
#
169169
# Example:
170170
#
171-
# HTTPResponseFactory.create(
171+
# Gem::HTTPResponseFactory.create(
172172
# body: "",
173173
# code: 301,
174174
# msg: "Moved Permanently",
175175
# headers: { "location" => "http://example.com" }
176176
# )
177177
#
178178

179-
class HTTPResponseFactory
179+
class Gem::HTTPResponseFactory
180180
def self.create(body:, code:, msg:, headers: {})
181181
response = Net::HTTPResponse.send(:response_class, code.to_s).new("1.0", code.to_s, msg)
182182
response.instance_variable_set(:@body, body)
@@ -374,7 +374,7 @@ def write_spec(spec) # :nodoc:
374374
#
375375
# This class was added to flush out problems in Rubinius' IO implementation.
376376

377-
class TempIO < Tempfile
377+
class Gem::TempIO < Tempfile
378378
##
379379
# Creates a new TempIO that will be initialized to contain +string+.
380380

@@ -393,3 +393,8 @@ def string
393393
Gem.read_binary path
394394
end
395395
end
396+
397+
class Gem::TestCase
398+
TempIO = Gem::TempIO
399+
HTTPResponseFactory = Gem::HTTPResponseFactory
400+
end

0 commit comments

Comments
 (0)