Expect(password).To(Equal("password")) Expect(spaceGUID).To(Equal("my-space-guid")) }) It("tells the user it is creating the service broker in the targeted org and space", func() { Expect(runCLIErr).NotTo(HaveOccurred()) Expect(ui.Outputs()).To(ContainSubstrings( []string{"Creating service broker service-broker in org my-org / space my-space as my-user"}, []string{"OK"}, )) }) }) Context("when creating the service broker succeeds", func() { BeforeEach(func() { serviceBrokerRepo.CreateReturns(nil) }) It("says OK", func() { Expect(runCLIErr).NotTo(HaveOccurred()) Expect(ui.Outputs()).To(ContainSubstrings([]string{"OK"})) }) }) Context("when creating the service broker fails", func() { BeforeEach(func() { serviceBrokerRepo.CreateReturns(errors.New("create-err")) }) It("returns an error", func() { Expect(runCLIErr).To(HaveOccurred())