JustBeforeEach(func() { runCLIErr = cmd.Execute(flagContext) }) It("tells the user it will create the user provided service", func() { Expect(runCLIErr).NotTo(HaveOccurred()) Expect(ui.Outputs()).To(ContainSubstrings( []string{"Creating user provided service service-instance in org"}, )) }) It("tries to create the user provided service instance", func() { Expect(runCLIErr).NotTo(HaveOccurred()) Expect(serviceInstanceRepo.CreateCallCount()).To(Equal(1)) name, drainURL, routeServiceURL, credentialsMap := serviceInstanceRepo.CreateArgsForCall(0) Expect(name).To(Equal("service-instance")) Expect(drainURL).To(Equal("")) Expect(routeServiceURL).To(Equal("")) Expect(credentialsMap).To(Equal(map[string]interface{}{})) }) Context("when creating the user provided service instance succeeds", func() { BeforeEach(func() { serviceInstanceRepo.CreateReturns(nil) }) It("tells the user OK", func() { Expect(runCLIErr).NotTo(HaveOccurred()) Expect(ui.Outputs()).To(ContainSubstrings( []string{"OK"},