Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectorMock ¶
type ConnectorMock struct { // ConnectFunc mocks the Connect method. ConnectFunc func(ctx context.Context, host string, user string) (*executor.Remote, error) // contains filtered or unexported fields }
ConnectorMock is a mock implementation of runner.Connector.
func TestSomethingThatUsesConnector(t *testing.T) { // make and configure a mocked runner.Connector mockedConnector := &ConnectorMock{ ConnectFunc: func(ctx context.Context, host string, user string) (*executor.Remote, error) { panic("mock out the Connect method") }, } // use mockedConnector in code that requires runner.Connector // and then make assertions. }
func (*ConnectorMock) Connect ¶
func (mock *ConnectorMock) Connect(ctx context.Context, host string, user string) (*executor.Remote, error)
Connect calls ConnectFunc.
func (*ConnectorMock) ConnectCalls ¶
func (mock *ConnectorMock) ConnectCalls() []struct { Ctx context.Context Host string User string }
ConnectCalls gets all the calls that were made to Connect. Check the length with:
len(mockedConnector.ConnectCalls())
Click to show internal directories.
Click to hide internal directories.