ReceiveQuestion gets the next question and options from the channel and returns them in a wrapper struct. If the channel is closed, will still return a valid wrapper, but the wrapped contents will be nil
()
| 290 | // ReceiveQuestion gets the next question and options from the channel and returns them in a wrapper struct. |
| 291 | // If the channel is closed, will still return a valid wrapper, but the wrapped contents will be nil |
| 292 | func (m *AskMocker) ReceiveQuestion() *QuestionWrapper { |
| 293 | prompt, askOptions, ok := m.receiveQuestion() |
| 294 | if !ok { |
| 295 | return &QuestionWrapper{Asker: m} |
| 296 | } |
| 297 | return &QuestionWrapper{Question: prompt, Options: askOptions, Asker: m} |
| 298 | } |
| 299 | |
| 300 | // ExpectQuestion calls ReceiveQuestion and asserts that the received survey prompt matches `question` |
| 301 | func (m *AskMocker) ExpectQuestion(t *testing.T, question survey.Prompt) *QuestionWrapper { |