[rubygems/rubygems] Standarize "ins" test command too

https://github.com/rubygems/rubygems/commit/517e9a8669
This commit is contained in:
David Rodríguez 2024-09-26 13:09:22 +02:00 committed by Hiroshi SHIBATA
parent 8e73609c7b
commit 3d1eb62bf3
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2
2 changed files with 12 additions and 4 deletions

View File

@ -0,0 +1,7 @@
# frozen_string_literal: true
class Gem::Commands::InsCommand < Gem::Command
def initialize
super("ins", "Does something different from install", {})
end
end

View File

@ -50,16 +50,17 @@ class TestGemCommandManager < Gem::TestCase
end
def test_find_command_ambiguous_exact
ins_command = Class.new
Gem::Commands.send :const_set, :InsCommand, ins_command
old_load_path = $:.dup
$: << File.expand_path("test/rubygems", PROJECT_DIR)
@command_manager.register_command :ins
command = @command_manager.find_command "ins"
assert_kind_of ins_command, command
assert_kind_of Gem::Commands::InsCommand, command
ensure
Gem::Commands.send :remove_const, :InsCommand
$:.replace old_load_path
@command_manager.unregister_command :ins
end
def test_find_command_unknown