Skip to content

Commit

Permalink
Use test-unit instead of minitest
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed May 11, 2021
1 parent d1c05f9 commit a857152
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/rubygems/test_case.rb
Expand Up @@ -12,7 +12,7 @@
end

begin
gem 'minitest', '~> 5.13'
gem 'test-unit', '~> 3.0'
rescue Gem::LoadError
end

Expand Down Expand Up @@ -41,7 +41,7 @@

ENV["MT_NO_PLUGINS"] = "true"

require 'minitest/autorun'
require 'test/unit'

ENV["JARS_SKIP"] = "true" if Gem.java_platform? # avoid unnecessary and noisy `jar-dependencies` post install hook

Expand Down Expand Up @@ -111,7 +111,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 < Test::Unit::TestCase
extend Gem::Deprecate

attr_accessor :fetcher # :nodoc:
Expand Down Expand Up @@ -140,7 +140,7 @@ def assert_activate(expected, *specs)
end

def assert_directory_exists(path, msg = nil)
msg = message(msg) { "Expected path '#{path}' to be a directory" }
msg = build_message(msg, "Expected path '#{path}' to be a directory")
assert_path_exists path
assert File.directory?(path), msg
end
Expand Down Expand Up @@ -262,19 +262,19 @@ def parse_make_command_line(line)

def assert_contains_make_command(target, output, msg = nil)
if output.match(/\n/)
msg = message(msg) do
msg = build_message(msg,
"Expected output containing make command \"%s\", but was \n\nBEGIN_OF_OUTPUT\n%sEND_OF_OUTPUT" % [
('%s %s' % [make_command, target]).rstrip,
output,
]
end
)
else
msg = message(msg) do
msg = build_message(msg,
'Expected make command "%s": %s' % [
('%s %s' % [make_command, target]).rstrip,
output,
]
end
)
end

assert scan_make_command_lines(output).any? {|line|
Expand Down Expand Up @@ -1012,6 +1012,7 @@ def util_setup_spec_fetcher(*specs)

spec_fetcher.specs[@uri] = []
all.each do |spec|

spec_fetcher.specs[@uri] << spec.name_tuple
end

Expand Down

0 comments on commit a857152

Please sign in to comment.