(t *testing.T)
| 41 | } |
| 42 | |
| 43 | func 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 | |
| 57 | func TestQuestion_DeleteWithConfirmation_deleteError(t *testing.T) { |
| 58 | qa := testutil.NewAskMocker() |
nothing calls this directly
no test coverage detected