It("tries to update the user provided service instance with the credentials", func() { ui.Inputs = []string{"value1", "value2"} cmd.Execute(flagContext) Expect(serviceInstanceRepo.UpdateCallCount()).To(Equal(1)) serviceInstanceFields := serviceInstanceRepo.UpdateArgsForCall(0) Expect(serviceInstanceFields.Params).To(Equal(map[string]interface{}{ "key1": "value1", "key2": "value2", })) }) }) Context("when updating succeeds", func() { BeforeEach(func() { serviceInstanceRepo.UpdateReturns(nil) }) It("tells the user OK", func() { cmd.Execute(flagContext) Expect(ui.Outputs).To(ContainSubstrings( []string{"OK"}, )) }) It("prints a tip", func() { cmd.Execute(flagContext) Expect(ui.Outputs).To(ContainSubstrings( []string{"TIP"}, )) })