MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / ReceiveQuestion

Method ReceiveQuestion

test/testutil/fakesurvey.go:292–298  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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
292func (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`
301func (m *AskMocker) ExpectQuestion(t *testing.T, question survey.Prompt) *QuestionWrapper {

Callers 2

ExpectQuestionMethod · 0.95

Calls 1

receiveQuestionMethod · 0.95

Tested by 1