Пример #1
0
		Context("when there is no current version", func() {
			It("checks from nil", func() {
				Eventually(times).Should(Receive())

				_, version := fakeResource.CheckArgsForCall(0)
				Ω(version).Should(BeNil())
			})
		})

		Context("when there is a current version", func() {
			BeforeEach(func() {
				fakeRadarDB.GetLatestVersionedResourceReturns(
					db.SavedVersionedResource{
						ID: 1,
						VersionedResource: db.VersionedResource{
							Version: db.Version{
								"version": "1",
							},
						},
					}, nil)
			})

			It("checks from it", func() {
				Eventually(times).Should(Receive())

				_, version := fakeResource.CheckArgsForCall(0)
				Ω(version).Should(Equal(atc.Version{"version": "1"}))

				fakeRadarDB.GetLatestVersionedResourceReturns(db.SavedVersionedResource{
					ID:                2,
					VersionedResource: db.VersionedResource{Version: db.Version{"version": "2"}},
Пример #2
0
			Context("when there is no current version", func() {
				It("checks from nil", func() {
					<-times

					_, version := fakeResource.CheckArgsForCall(0)
					Expect(version).To(BeNil())
				})
			})

			Context("when there is a current version", func() {
				BeforeEach(func() {
					fakeRadarDB.GetLatestVersionedResourceReturns(
						db.SavedVersionedResource{
							ID: 1,
							VersionedResource: db.VersionedResource{
								Version: db.Version{
									"version": "1",
								},
							},
						}, true, nil)
				})

				It("checks from it", func() {
					<-times

					_, version := fakeResource.CheckArgsForCall(0)
					Expect(version).To(Equal(atc.Version{"version": "1"}))

					fakeRadarDB.GetLatestVersionedResourceReturns(db.SavedVersionedResource{
						ID:                2,
						VersionedResource: db.VersionedResource{Version: db.Version{"version": "2"}},