It("prints an error if updating the plan fails", func() { actor.UpdateSinglePlanForServiceReturns(errors.New("could not find service")) Expect(runCommand([]string{"-p", servicePlanName, serviceName})).To(BeFalse()) Expect(ui.Outputs()).To(ContainSubstrings( []string{"could not find service"}, )) }) It("disables the plan", func() { Expect(runCommand([]string{"-p", publicServicePlanName, serviceName})).To(BeTrue()) Expect(ui.Outputs()).To(ContainSubstrings( []string{"OK"}, )) Expect(actor.UpdateSinglePlanForServiceCallCount()).To(Equal(1)) service, plan, disable := actor.UpdateSinglePlanForServiceArgsForCall(0) Expect(service).To(Equal(serviceName)) Expect(plan).To(Equal(publicServicePlanName)) Expect(disable).To(BeFalse()) }) }) Context("the user provides an org", func() { It("prints an error if updating the plan fails", func() { actor.UpdateOrgForServiceReturns(errors.New("could not find org")) Expect(runCommand([]string{"-o", "not-findable-org", serviceName})).To(BeFalse()) Expect(ui.Outputs()).To(ContainSubstrings( []string{"could not find org"}, ))