Ejemplo n.º 1
0
				count, placementError, err := appExaminer.RunningAppInstancesInfo("americano-app")
				Expect(err).NotTo(HaveOccurred())
				Expect(count).To(Equal(2))
				Expect(placementError).To(BeTrue())
			})
		})
	})

	Describe("AppExists", func() {
		It("returns true if the docker app exists", func() {
			actualLRPs := []receptor.ActualLRPResponse{
				{ProcessGuid: "americano-app"},
			}
			fakeReceptorClient.ActualLRPsReturns(actualLRPs, nil)

			exists, err := appExaminer.AppExists("americano-app")
			Expect(err).NotTo(HaveOccurred())
			Expect(exists).To(BeTrue())
		})

		It("returns false if the docker app does not exist", func() {
			fakeReceptorClient.ActualLRPsReturns([]receptor.ActualLRPResponse{}, nil)

			exists, err := appExaminer.AppExists("americano-app")
			Expect(err).NotTo(HaveOccurred())
			Expect(exists).To(BeFalse())
		})

		Describe("returning errors from the receptor", func() {
			It("returns errors fetching the status", func() {
				fakeReceptorClient.ActualLRPsReturns([]receptor.ActualLRPResponse{}, errors.New("Something Bad"))