ruby-changes:61062
From: Hiroshi <ko1@a...>
Date: Fri, 8 May 2020 07:39:28 +0900 (JST)
Subject: [ruby-changes:61062] 3041e2626d (master): [rubygems/rubygems] Revert https://github.com/rubygems/rubygems/pull/3445
https://git.ruby-lang.org/ruby.git/commit/?id=3041e2626d From 3041e2626d6fd488c48106b57e378017ded678b7 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Mon, 30 Mar 2020 12:18:41 +0900 Subject: [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 diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index 1a2746d..054deb2 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -11,7 +11,10 @@ if File.exist?(bundler_gemspec) https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L11 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 https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L98 # 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 https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L127 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 https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L225 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/