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.
# File lib/rubygems/command.rb, line 322
def when_invoked(&block)
@when_invoked = block
end