Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Confirm = func(prompt string, result *bool) error { p := &survey.Confirm{ Message: prompt, Default: true, } return SurveyAskOne(p, result) }
View Source
var SurveyAsk = func(qs []*survey.Question, response interface{}, opts ...survey.AskOpt) error {
return survey.Ask(qs, response, opts...)
}
View Source
var SurveyAskOne = func(p survey.Prompt, response interface{}, opts ...survey.AskOpt) error {
return survey.AskOne(p, response, opts...)
}
Functions ¶
func StubConfirm ¶
func StubConfirm(result bool) func()
Types ¶
type AskStubber ¶
type AskStubber struct {
// contains filtered or unexported fields
}
func InitAskStubber
deprecated
func InitAskStubber() (*AskStubber, func())
Deprecated: use NewAskStubber
func NewAskStubber ¶
func NewAskStubber(t testing) *AskStubber
func (*AskStubber) Stub
deprecated
func (as *AskStubber) Stub(stubbedQuestions []*QuestionStub)
Deprecated: use StubPrompt
func (*AskStubber) StubOne
deprecated
func (as *AskStubber) StubOne(value interface{})
Deprecated: use StubPrompt
func (*AskStubber) StubPrompt ¶
func (as *AskStubber) StubPrompt(msg string) *QuestionStub
StubPrompt records a stub for an interactive prompt matched by its message.
type QuestionStub ¶
type QuestionStub struct { Name string Value interface{} Default bool // contains filtered or unexported fields }
func (*QuestionStub) AnswerDefault ¶
func (s *QuestionStub) AnswerDefault() *QuestionStub
AnswerDefault marks the current stub to be answered with the default value for the prompt question.
func (*QuestionStub) AnswerWith ¶
func (s *QuestionStub) AnswerWith(v interface{}) *QuestionStub
AnswerWith defines an answer for the given stub.
func (*QuestionStub) AssertOptions ¶
func (s *QuestionStub) AssertOptions(opts []string) *QuestionStub
AssertOptions asserts the options presented to the user in Selects and MultiSelects.
Click to show internal directories.
Click to hide internal directories.