}) It("stops the app with the given name", func() { runCommand("my-app") Expect(ui.Outputs).To(ContainSubstrings( []string{"Stopping app", "my-app", "my-org", "my-space", "my-user"}, []string{"OK"}, )) Expect(requirementsFactory.ApplicationName).To(Equal("my-app")) Expect(appRepo.UpdateAppGuid).To(Equal("my-app-guid")) }) It("warns the user when stopping the app fails", func() { appRepo.UpdateErr = true runCommand("my-app") Expect(ui.Outputs).To(ContainSubstrings( []string{"Stopping", "my-app"}, []string{"FAILED"}, []string{"Error updating app."}, )) Expect(appRepo.UpdateAppGuid).To(Equal("my-app-guid")) }) Context("when the app is stopped", func() { BeforeEach(func() { app.State = "stopped" })