Documentation ¶
Overview ¶
Package exec provides wrapped implementations of os/exec's Command and CommandContext functions that allow for command creation to be overridden, thereby allowing commands to be mocked.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CmdCreator ¶
CmdCreator instances are used to create commands. os/exec.CommandContext is a valid CmdCreator.
type CmdCreatorMiddleware ¶
type CmdCreatorMiddleware struct {
// contains filtered or unexported fields
}
CmdCreatorMiddleware creates *exec.Cmd instances that delegate command creation to a provided callback.
func NewMiddleware ¶
func NewMiddleware(mock func(context.Context, CmdCreator, string, ...string) *goexec.Cmd) CmdCreatorMiddleware
NewMiddleware adds a middleware to the command creation stack.
func (CmdCreatorMiddleware) Remove ¶
func (mc CmdCreatorMiddleware) Remove()
Remove removes the command creation middleware from the stack.
Click to show internal directories.
Click to hide internal directories.