Confirm calls ConfirmFunc.
(prompt string, defaultValue bool)
| 198 | |
| 199 | // Confirm calls ConfirmFunc. |
| 200 | func (mock *PrompterMock) Confirm(prompt string, defaultValue bool) (bool, error) { |
| 201 | if mock.ConfirmFunc == nil { |
| 202 | panic("PrompterMock.ConfirmFunc: method is nil but Prompter.Confirm was just called") |
| 203 | } |
| 204 | callInfo := struct { |
| 205 | Prompt string |
| 206 | DefaultValue bool |
| 207 | }{ |
| 208 | Prompt: prompt, |
| 209 | DefaultValue: defaultValue, |
| 210 | } |
| 211 | mock.lockConfirm.Lock() |
| 212 | mock.calls.Confirm = append(mock.calls.Confirm, callInfo) |
| 213 | mock.lockConfirm.Unlock() |
| 214 | return mock.ConfirmFunc(prompt, defaultValue) |
| 215 | } |
| 216 | |
| 217 | // ConfirmCalls gets all the calls that were made to Confirm. |
| 218 | // Check the length with: |
nothing calls this directly
no outgoing calls
no test coverage detected