}) It("fails validation when deployment file not existed", func() { cmd = bmp.NewBmsCommand(options, fakeBmpClient) validate, err := cmd.Validate() Expect(validate).To(BeFalse()) Expect(err).To(HaveOccurred()) }) }) }) Describe("#Execute", func() { Context("executes a good BmsCommand", func() { BeforeEach(func() { fakeBmpClient.BmsResponse.Status = 200 fakeBmpClient.BmsErr = nil }) It("executes with no error", func() { rc, err := cmd.Execute([]string{"bmp", "bms"}) Expect(rc).To(Equal(0)) Expect(err).ToNot(HaveOccurred()) }) }) Context("executes a bad Bmscommand", func() { BeforeEach(func() { fakeBmpClient.BmsResponse.Status = 404 fakeBmpClient.BmsErr = errors.New("fake-error") })