args := []string{ "cool-web-app", "--http-route=foo.com:8080", } test_helpers.ExecuteCommandWithArgs(updateCommand, args) Expect(outputBuffer).To(test_helpers.SayLine("Error querying application status: Major Fault")) Expect(fakeAppRunner.UpdateAppCallCount()).To(Equal(0)) Expect(fakeExitHandler.ExitCalledWith).To(Equal([]int{exit_codes.CommandFailed})) }) }) Context("when the receptor returns errors", func() { It("outputs error messages", func() { fakeAppRunner.UpdateAppReturns(errors.New("Major Fault")) args := []string{ "cool-web-app", "--http-route=foo.com:8080", } test_helpers.ExecuteCommandWithArgs(updateCommand, args) Expect(outputBuffer).To(test_helpers.SayLine("Error updating application: Major Fault")) Expect(fakeAppRunner.UpdateAppCallCount()).To(Equal(1)) Expect(fakeExitHandler.ExitCalledWith).To(Equal([]int{exit_codes.CommandFailed})) }) }) Context("malformed route", func() { Context("when the http route is malformed", func() {