コード例 #1
0
ファイル: radar_test.go プロジェクト: utako/atc
		Context("when checking fails", func() {
			disaster := errors.New("nope")

			BeforeEach(func() {
				fakeResource.CheckReturns(nil, disaster)
			})

			It("exits with the failure", func() {
				Eventually(process.Wait()).Should(Receive(Equal(disaster)))
			})
		})

		Context("when the pipeline is paused", func() {
			BeforeEach(func() {
				fakeRadarDB.IsPausedReturns(true, nil)
			})

			It("exits the process", func() {
				Consistently(times, 500*time.Millisecond).ShouldNot(Receive())
			})
		})

		Context("when checking if the resource is paused fails", func() {
			disaster := errors.New("disaster")

			BeforeEach(func() {
				fakeRadarDB.IsPausedReturns(false, disaster)
			})

			It("exits the process", func() {