Confirm calls ConfirmFunc.
(message string)
| 39 | |
| 40 | // Confirm calls ConfirmFunc. |
| 41 | func (mock *prompterMock) Confirm(message string) (bool, error) { |
| 42 | if mock.ConfirmFunc == nil { |
| 43 | panic("prompterMock.ConfirmFunc: method is nil but prompter.Confirm was just called") |
| 44 | } |
| 45 | callInfo := struct { |
| 46 | Message string |
| 47 | }{ |
| 48 | Message: message, |
| 49 | } |
| 50 | mock.lockConfirm.Lock() |
| 51 | mock.calls.Confirm = append(mock.calls.Confirm, callInfo) |
| 52 | mock.lockConfirm.Unlock() |
| 53 | return mock.ConfirmFunc(message) |
| 54 | } |
| 55 | |
| 56 | // ConfirmCalls gets all the calls that were made to Confirm. |
| 57 | // Check the length with: |
nothing calls this directly
no outgoing calls
no test coverage detected