Expect(ui.Outputs).To(ContainSubstrings( []string{"Deleting space quota", "my-quota", "as", "my-user"}, []string{"OK"}, )) }) It("does not prompt when the -f flag is provided", func() { runCommand("-f", "my-quota") Expect(quotaRepo.DeleteArgsForCall(0)).To(Equal("my-quota-guid")) Expect(ui.Prompts).To(BeEmpty()) }) It("shows an error when deletion fails", func() { quotaRepo.DeleteReturns(errors.New("some error")) runCommand("-f", "my-quota") Expect(ui.Outputs).To(ContainSubstrings( []string{"Deleting", "my-quota"}, []string{"FAILED"}, )) }) }) Context("when finding the quota fails", func() { Context("when the quota provided does not exist", func() { BeforeEach(func() { quotaRepo.FindByNameReturns(models.SpaceQuota{}, errors.NewModelNotFoundError("Quota", "non-existent-quota")) })