Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandRunnerMock ¶
type CommandRunnerMock struct {
// RunFunc mocks the Run method.
RunFunc func(ctx context.Context, name string, args ...string) (io.Reader, func() error, error)
// contains filtered or unexported fields
}
CommandRunnerMock is a mock implementation of executor.CommandRunner.
func TestSomethingThatUsesCommandRunner(t *testing.T) {
// make and configure a mocked executor.CommandRunner
mockedCommandRunner := &CommandRunnerMock{
RunFunc: func(ctx context.Context, name string, args ...string) (io.Reader, func() error, error) {
panic("mock out the Run method")
},
}
// use mockedCommandRunner in code that requires executor.CommandRunner
// and then make assertions.
}
Click to show internal directories.
Click to hide internal directories.