Beispiel #1
0
				Expect(ui.Outputs()).To(ContainSubstrings(
					[]string{"Unbinding app", "my-service", "my-app", "my-org", "my-space", "my-user"},
					[]string{"OK"},
				))

				Expect(serviceBindingRepo.DeleteCallCount()).To(Equal(1))
				serviceInstance, applicationGUID := serviceBindingRepo.DeleteArgsForCall(0)
				Expect(serviceInstance).To(Equal(serviceInstance))
				Expect(applicationGUID).To(Equal("my-app-guid"))
			})
		})

		Context("when the service instance does not exist", func() {
			BeforeEach(func() {
				serviceBindingRepo.DeleteReturns(false, nil)
			})

			It("warns the user the the service instance does not exist", func() {
				callUnbindService([]string{"my-app", "my-service"})

				Expect(ui.Outputs()).To(ContainSubstrings(
					[]string{"Unbinding app", "my-service", "my-app"},
					[]string{"OK"},
					[]string{"my-service", "my-app", "did not exist"},
				))

				Expect(serviceBindingRepo.DeleteCallCount()).To(Equal(1))
				serviceInstance, applicationGUID := serviceBindingRepo.DeleteArgsForCall(0)
				Expect(serviceInstance).To(Equal(serviceInstance))
				Expect(applicationGUID).To(Equal("my-app-guid"))