Select calls SelectFunc.
(prompt string, defaultValue string, options []string)
| 489 | |
| 490 | // Select calls SelectFunc. |
| 491 | func (mock *PrompterMock) Select(prompt string, defaultValue string, options []string) (int, error) { |
| 492 | if mock.SelectFunc == nil { |
| 493 | panic("PrompterMock.SelectFunc: method is nil but Prompter.Select was just called") |
| 494 | } |
| 495 | callInfo := struct { |
| 496 | Prompt string |
| 497 | DefaultValue string |
| 498 | Options []string |
| 499 | }{ |
| 500 | Prompt: prompt, |
| 501 | DefaultValue: defaultValue, |
| 502 | Options: options, |
| 503 | } |
| 504 | mock.lockSelect.Lock() |
| 505 | mock.calls.Select = append(mock.calls.Select, callInfo) |
| 506 | mock.lockSelect.Unlock() |
| 507 | return mock.SelectFunc(prompt, defaultValue, options) |
| 508 | } |
| 509 | |
| 510 | // SelectCalls gets all the calls that were made to Select. |
| 511 | // Check the length with: |
nothing calls this directly
no outgoing calls
no test coverage detected