(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestQuestion_DeleteWithConfirmation_Success(t *testing.T) { |
| 16 | qa := testutil.NewAskMocker() |
| 17 | errReceiver := testutil.GoBegin(func() error { |
| 18 | return question.DeleteWithConfirmation(qa.AsAsker(), "animal", "dog", "1", func() error { return nil }) |
| 19 | }) |
| 20 | |
| 21 | qa.ExpectQuestion(t, &survey.Input{ |
| 22 | Message: `You are about to delete the animal "dog" (1). This action cannot be reversed. To confirm, type the animal name:`, |
| 23 | }).AnswerWith("dog") |
| 24 | |
| 25 | err := <-errReceiver |
| 26 | assert.Nil(t, err) |
| 27 | } |
| 28 | |
| 29 | func TestQuestion_DeleteWithConfirmation_invalidResponse(t *testing.T) { |
| 30 | qa := testutil.NewAskMocker() |
nothing calls this directly
no test coverage detected