Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Gem::Command#when_invoked
when_invoked(&block)
lib/rubygems/command.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/rubygems/command.rb, line 343
def when_invoked(&block)
@when_invoked = block
end
Call the given block when invoked.
Normal command invocations just executes the execute method of the command. Specifying an invocation block allows the test methods to override the normal action of a command to determine that it has been invoked correctly.