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

Function TestQuestion_DeleteWithConfirmation_error

pkg/question/input_test.go:43–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

41}
42
43func TestQuestion_DeleteWithConfirmation_error(t *testing.T) {
44 qa := testutil.NewAskMocker()
45 errReceiver := testutil.GoBegin(func() error {
46 return question.DeleteWithConfirmation(qa.AsAsker(), "animal", "dog", "1", func() error { return nil })
47 })
48
49 qa.ExpectQuestion(t, &survey.Input{
50 Message: `You are about to delete the animal "dog" (1). This action cannot be reversed. To confirm, type the animal name:`,
51 }).AnswerWithError(errors.New("ouch"))
52
53 err := <-errReceiver
54 assert.Equal(t, errors.New("ouch"), err)
55}
56
57func TestQuestion_DeleteWithConfirmation_deleteError(t *testing.T) {
58 qa := testutil.NewAskMocker()

Callers

nothing calls this directly

Calls 6

AsAskerMethod · 0.95
ExpectQuestionMethod · 0.95
NewAskMockerFunction · 0.92
GoBeginFunction · 0.92
DeleteWithConfirmationFunction · 0.92
AnswerWithErrorMethod · 0.80

Tested by

no test coverage detected