Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutorMock ¶
type ExecutorMock struct {
// ExecuteFunc mocks the Execute method.
ExecuteFunc func(command string, args []string) ([]byte, error)
// contains filtered or unexported fields
}
ExecutorMock is a mock implementation of executor.Executor.
func TestSomethingThatUsesExecutor(t *testing.T) {
// make and configure a mocked executor.Executor
mockedExecutor := &ExecutorMock{
ExecuteFunc: func(command string, args []string) ([]byte, error) {
panic("mock out the Execute method")
},
}
// use mockedExecutor in code that requires executor.Executor
// and then make assertions.
}
func (*ExecutorMock) Execute ¶
func (mock *ExecutorMock) Execute(command string, args []string) ([]byte, error)
Execute calls ExecuteFunc.
func (*ExecutorMock) ExecuteCalls ¶
func (mock *ExecutorMock) ExecuteCalls() []struct { Command string Args []string }
ExecuteCalls gets all the calls that were made to Execute. Check the length with:
len(mockedExecutor.ExecuteCalls())
Click to show internal directories.
Click to hide internal directories.