summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-03-30 12:18:41 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-08 07:38:50 +0900
commit3041e2626d6fd488c48106b57e378017ded678b7 (patch)
tree55422e4a80b8c1dfde23596cf8cdce29cb869c13
parent3256480317177a2cfd31cfa2c5ecf45dd8c1cc44 (diff)
[rubygems/rubygems] Revert https://github.com/rubygems/rubygems/pull/3445
These changes completely broke the test suite on ruby core repository. https://github.com/rubygems/rubygems/commit/84b0bea3e1
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3087
-rw-r--r--lib/rubygems/test_case.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 1a2746d855..054deb222a 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -11,7 +11,10 @@ if File.exist?(bundler_gemspec)
Gem::Specification.dirs.shift
end
-gem 'minitest', '~> 5.13'
+begin
+ gem 'minitest', '~> 5.13'
+rescue Gem::LoadError
+end
begin
require 'simplecov'
@@ -95,7 +98,7 @@ end
# and uninstall gems, fetch remote gems through a stub fetcher and be assured
# your normal set of gems is not affected.
-class Gem::TestCase < Minitest::Test
+class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Unit::TestCase)
extend Gem::Deprecate
@@ -124,6 +127,11 @@ class Gem::TestCase < Minitest::Test
assert_equal expected.sort, loaded.sort if expected
end
+ def assert_path_exists(path, msg = nil)
+ msg = message(msg) { "Expected path '#{path}' to exist" }
+ assert File.exist?(path), msg
+ end
+
def assert_directory_exists(path, msg = nil)
msg = message(msg) { "Expected path '#{path}' to be a directory" }
assert_path_exists path
@@ -217,6 +225,11 @@ class Gem::TestCase < Minitest::Test
end
end
+ def refute_path_exists(path, msg = nil)
+ msg = message(msg) { "Expected path '#{path}' to not exist" }
+ refute File.exist?(path), msg
+ end
+
def scan_make_command_lines(output)
output.scan(/^#{Regexp.escape make_command}(?:[[:blank:]].*)?$/)
end