Example #1
0
						cmd.Execute(flagContext)
					})

					It("does not warn", func() {
						Expect(func() []string { return ui.Outputs }).NotTo(ContainSubstrings(
							[]string{"Bind cancelled"},
						))
					})

					It("tries to bind the route service", func() {
						Expect(routeServiceBindingRepo.BindCallCount()).To(Equal(1))
					})

					Context("when binding the route service succeeds", func() {
						BeforeEach(func() {
							routeServiceBindingRepo.BindReturns(nil)
						})

						It("says OK", func() {
							Expect(ui.Outputs).To(ContainSubstrings(
								[]string{"OK"},
							))
						})
					})

					Context("when binding the route service fails because it is already bound", func() {
						BeforeEach(func() {
							routeServiceBindingRepo.BindReturns(errors.NewHTTPError(http.StatusOK, errors.ServiceInstanceAlreadyBoundToSameRoute, "http-err"))
						})

						It("says OK", func() {