Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IUserInputMock ¶
type IUserInputMock struct { // AskBoolFunc mocks the AskBool method. AskBoolFunc func(question string, opts *common.UserInputOptions) bool // contains filtered or unexported fields }
IUserInputMock is a mock implementation of common.IUserInput.
func TestSomethingThatUsesIUserInput(t *testing.T) { // make and configure a mocked common.IUserInput mockedIUserInput := &IUserInputMock{ AskBoolFunc: func(question string, opts *common.UserInputOptions) bool { panic("mock out the AskBool method") }, } // use mockedIUserInput in code that requires common.IUserInput // and then make assertions. }
func (*IUserInputMock) AskBool ¶
func (mock *IUserInputMock) AskBool(question string, opts *common.UserInputOptions) bool
AskBool calls AskBoolFunc.
func (*IUserInputMock) AskBoolCalls ¶
func (mock *IUserInputMock) AskBoolCalls() []struct { Question string Opts *common.UserInputOptions }
AskBoolCalls gets all the calls that were made to AskBool. Check the length with:
len(mockedIUserInput.AskBoolCalls())
Click to show internal directories.
Click to hide internal directories.