コード例 #1
0
					[]string{"Service Instance is not user provided"},
				))
			})
		})

		Context("when the service instance is user-provided", func() {
			var serviceInstance models.ServiceInstance
			BeforeEach(func() {
				serviceInstance = models.ServiceInstance{
					ServicePlan: models.ServicePlanFields{
						GUID:        "",
						Description: "service-plan-description",
					},
				}
				serviceInstance.Name = "service-instance"
				serviceInstance.Params = map[string]interface{}{}
				serviceInstanceRequirement.GetServiceInstanceReturns(serviceInstance)
			})

			It("tells the user it is updating the user provided service", func() {
				cmd.Execute(flagContext)
				Expect(ui.Outputs).To(ContainSubstrings(
					[]string{"Updating user provided service service-instance in org"},
				))
			})

			It("tries to update the service instance", func() {
				cmd.Execute(flagContext)
				Expect(serviceInstanceRepo.UpdateCallCount()).To(Equal(1))
				Expect(serviceInstanceRepo.UpdateArgsForCall(0)).To(Equal(serviceInstance.ServiceInstanceFields))
			})