[rubygems/rubygems] Standarize "ins" test command too
https://github.com/rubygems/rubygems/commit/517e9a8669
This commit is contained in:
parent
8e73609c7b
commit
3d1eb62bf3
7
test/rubygems/rubygems/commands/ins_command.rb
Normal file
7
test/rubygems/rubygems/commands/ins_command.rb
Normal 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
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user