コード例 #1
0
			appSummaryRepo.GetSummarySummary = app
			appInstancesRepo.GetInstancesReturns(instances, nil)
			requirementsFactory.Application = app
			updateCommandDependency(false)
		})

		Context("When app is a diego app", func() {
			It("uses noaa log library to gather metrics", func() {
				app.Diego = true
				appSummaryRepo.GetSummarySummary = app
				requirementsFactory.Application = app

				updateCommandDependency(false)
				runCommand("my-app")
				Ω(appLogsNoaaRepo.GetContainerMetricsCallCount()).To(Equal(1))
			})
			It("gracefully handles when /instances is down but /noaa is not", func() {
				app.Diego = true
				appSummaryRepo.GetSummarySummary = app
				requirementsFactory.Application = app
				appInstancesRepo.GetInstancesReturns([]models.AppInstanceFields{}, errors.New("danger will robinson"))
				updateCommandDependency(false)

				runCommand("my-app")
				Ω(appLogsNoaaRepo.GetContainerMetricsCallCount()).To(Equal(0))

			})
		})

		Context("When app is not a diego app", func() {