Documentation ¶
Index ¶
- func Cmd(command string, args []string) *exec.Cmd
- func CommandHelperProcess(t *testing.T)
- func Mock(f CommandFunc)
- func MockExecCommand(stdout io.Writer, stderr io.Writer) func(command string, args []string) *exec.Cmd
- func MockExecCommands(t *testing.T, commands []MockCommand) func()
- func Restore()
- type ApplyOptionFunc
- type Command
- type CommandFunc
- type CommandOption
- type MockCommand
- type UiErrorWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandHelperProcess ¶ added in v1.10.0
func Mock ¶
func Mock(f CommandFunc)
Enables mocking of the underlying ExecCommand command (defaults to exec.Command) and no-ops the OptionApplier function so they have no effect.
func MockExecCommand ¶
func MockExecCommands ¶ added in v1.10.0
func MockExecCommands(t *testing.T, commands []MockCommand) func()
Types ¶
type ApplyOptionFunc ¶
type ApplyOptionFunc func(option CommandOption, cmd *exec.Cmd)
var OptionApplier ApplyOptionFunc = applyOption
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func WithOptions ¶
func WithOptions(options ...CommandOption) *Command
type CommandFunc ¶
var ExecCommand CommandFunc = execCommand
type CommandOption ¶
func WithLogging ¶
func WithLogging(ui cli.Ui) CommandOption
func WithTermOutput ¶
func WithTermOutput() CommandOption
func WithUiOutput ¶
func WithUiOutput(ui cli.Ui) CommandOption
type MockCommand ¶ added in v1.10.0
type UiErrorWriter ¶
Click to show internal directories.
Click to hide internal directories.