Skip to content

Commit

Permalink
Revert #3445
Browse files Browse the repository at this point in the history
  These changes completely broke the test suite on ruby core repository.
  • Loading branch information
hsbt committed Mar 30, 2020
1 parent bd4b24b commit 84b0bea
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lib/rubygems/test_case.rb
Expand Up @@ -11,7 +11,10 @@
Gem::Specification.dirs.shift
end

gem 'minitest', '~> 5.13'
begin
gem 'minitest', '~> 5.13'
rescue Gem::LoadError
end

begin
require 'simplecov'
Expand Down Expand Up @@ -95,7 +98,7 @@ def self.specific_extra_args_hash=(value)
# 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

Expand Down Expand Up @@ -124,6 +127,11 @@ def assert_activate(expected, *specs)
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
Expand Down Expand Up @@ -217,6 +225,11 @@ def exeext(value)
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
Expand Down

0 comments on commit 84b0bea

Please sign in to comment.