MCPcopy Index your code
hub / github.com/cli/cli / prompterMock

Struct prompterMock

pkg/cmd/codespace/mock_prompter.go:25–38  ·  view source on GitHub ↗

prompterMock is a mock implementation of prompter. func TestSomethingThatUsesprompter(t *testing.T) { // make and configure a mocked prompter mockedprompter := &prompterMock{ ConfirmFunc: func(message string) (bool, error) { panic("mock out the Confirm method") }, } // use mock

Source from the content-addressed store, hash-verified

23//
24// }
25type prompterMock struct {
26 // ConfirmFunc mocks the Confirm method.
27 ConfirmFunc func(message string) (bool, error)
28
29 // calls tracks calls to the methods.
30 calls struct {
31 // Confirm holds details about calls to the Confirm method.
32 Confirm []struct {
33 // Message is the message argument value.
34 Message string
35 }
36 }
37 lockConfirm sync.RWMutex
38}
39
40// Confirm calls ConfirmFunc.
41func (mock *prompterMock) Confirm(message string) (bool, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected