It("fails with an error message when finding the instance fails", func() { serviceRepo.FindInstanceByNameErr = true runCommand( []string{"-f", "the-service-name"}, ) Expect(ui.Outputs).To(ContainSubstrings( []string{"FAILED"}, []string{"Error finding instance"}, )) }) It("fails with an error message when the purging request fails", func() { serviceRepo.PurgeServiceInstanceApiResponse = cferrors.New("crumpets insufficiently buttered") runCommand( []string{"-f", "the-service-name"}, ) Expect(ui.Outputs).To(ContainSubstrings( []string{"FAILED"}, []string{"crumpets insufficiently buttered"}, )) }) It("indicates when a service doesn't exist", func() { serviceRepo.FindInstanceByNameNotFound = true ui.Inputs = []string{"yes"}