Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Gem::Command#when_invoked

when_invoked(&block)

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.

See also #usage #wrap #show_lookup_failure also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1