[]string{"service instance fetch is very bad"}, )) }) }) }) Context("when the user does not confirm", func() { BeforeEach(func() { ui.Inputs = append(ui.Inputs, "no") }) It("does not continue the migration", func() { testcmd.RunCLICommand("migrate-service-instances", args, requirementsFactory, updateCommandDependency, false) Expect(ui.Outputs).ToNot(ContainSubstrings([]string{"Migrating"})) Expect(serviceRepo.MigrateServicePlanFromV1ToV2CallCount()).To(BeZero()) }) }) Context("when the user ignores confirmation using the force flag", func() { It("does not prompt the user for confirmation", func() { args = []string{"-f", "v1-service-label", "v1-provider-name", "v1-plan-name", "v2-service-label", "v2-plan-name"} testcmd.RunCLICommand("migrate-service-instances", args, requirementsFactory, updateCommandDependency, false) Expect(ui.Outputs).ToNot(ContainSubstrings([]string{"Really migrate"})) Expect(serviceRepo.MigrateServicePlanFromV1ToV2CallCount()).To(Equal(1)) }) }) }) })