It("fails validation with errors", func() { cmd = bmp.NewUpdateStateCommand(options, fakeBmpClient) validate, err := cmd.Validate() Expect(validate).To(BeFalse()) Expect(err).To(HaveOccurred()) }) }) }) }) Describe("#Execute", func() { Context("when executing a good UpdateStateCommand", func() { BeforeEach(func() { fakeBmpClient.UpdateStateResponse.Status = 200 fakeBmpClient.UpdateStateErr = nil userInput = "yes" cmd = bmp.NewFakeUpdateStateCommand(options, fakeBmpClient, userInput) }) It("executes a good UpdateStateCommand", func() { rc, err := cmd.Execute(args) Expect(rc).To(Equal(0)) Expect(err).ToNot(HaveOccurred()) }) }) Context("when executing a bad UpdateStateCommand", func() { Context("when confirmation fails", func() { BeforeEach(func() { userInput = "no"