Пример #1
0
		var executeCmdErr error

		BeforeEach(func() {
			applicationRequirement.GetApplicationReturns(models.Application{
				ApplicationFields: models.ApplicationFields{
					Name: "my-app",
					GUID: "my-app-guid",
				},
			})

			err := flagContext.Parse("my-app")
			Expect(err).NotTo(HaveOccurred())
		})

		JustBeforeEach(func() {
			executeCmdErr = cmd.Execute(flagContext)
		})

		Context("when no events exist", func() {
			BeforeEach(func() {
				eventsRepo.RecentEventsReturns([]models.EventFields{}, nil)

				cmd.SetDependency(deps, false)
				cmd.Requirements(reqFactory, flagContext)
			})

			It("tells the user", func() {
				Expect(executeCmdErr).NotTo(HaveOccurred())
				Expect(ui.Outputs()).To(ContainSubstrings(
					[]string{"events", "my-app"},
					[]string{"No events", "my-app"},