Documentation ¶
Overview ¶
Package exectest provides fake implementations of the exec package.
These implementations can be used to mock out the Executor in tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorExecutor ¶
type ErrorExecutor struct { FakeExecutor Err error }
func (*ErrorExecutor) Execute ¶
func (e *ErrorExecutor) Execute(opts exec.ExecuteOptions) error
type FailLaterExecutor ¶
type FailLaterExecutor struct { FakeExecutor Succeeds int64 // contains filtered or unexported fields }
FailLaterExecutor is the opposite of RetryExecutor. It fails after N Succeeds.
func (*FailLaterExecutor) Execute ¶
func (e *FailLaterExecutor) Execute(opts exec.ExecuteOptions) error
type FakeExecutor ¶
func (*FakeExecutor) Execute ¶
func (e *FakeExecutor) Execute(opts exec.ExecuteOptions) error
func (*FakeExecutor) ExecutedCmd ¶
func (e *FakeExecutor) ExecutedCmd(cmd string, args []string) bool
func (*FakeExecutor) GetCommands ¶
func (e *FakeExecutor) GetCommands(cmdName string) []command
type RetryExecutor ¶
type RetryExecutor struct { FakeExecutor // How many times will it fail before succeeding? Failures int64 // contains filtered or unexported fields }
RetryExecutor succeeds after N failures.
func (*RetryExecutor) Execute ¶
func (e *RetryExecutor) Execute(opts exec.ExecuteOptions) error
Click to show internal directories.
Click to hide internal directories.