Example #1
0
				check := 0
				fakeResource.CheckStub = func(source atc.Source, from atc.Version) ([]atc.Version, error) {
					defer GinkgoRecover()

					Ω(source).Should(Equal(resourceConfig.Source))

					checkedFrom <- from
					result := checkResults[check]
					check++

					return result, nil
				}
			})

			It("saves them all, in order", func() {
				Ω(fakeRadarDB.SaveResourceVersionsCallCount()).Should(Equal(1))

				resourceConfig, versions := fakeRadarDB.SaveResourceVersionsArgsForCall(0)
				Ω(resourceConfig).Should(Equal(atc.ResourceConfig{
					Name:   "some-resource",
					Type:   "git",
					Source: atc.Source{"uri": "http://example.com"},
				}))
				Ω(versions).Should(Equal([]atc.Version{
					{"version": "1"},
					{"version": "2"},
					{"version": "3"},
				}))
			})
		})
Example #2
0
					check := 0
					fakeResource.CheckStub = func(source atc.Source, from atc.Version) ([]atc.Version, error) {
						defer GinkgoRecover()

						Expect(source).To(Equal(resourceConfig.Source))

						checkedFrom <- from
						result := checkResults[check]
						check++

						return result, nil
					}
				})

				It("saves them all, in order", func() {
					Expect(fakeRadarDB.SaveResourceVersionsCallCount()).To(Equal(1))

					resourceConfig, versions := fakeRadarDB.SaveResourceVersionsArgsForCall(0)
					Expect(resourceConfig).To(Equal(atc.ResourceConfig{
						Name:   "some-resource",
						Type:   "git",
						Source: atc.Source{"uri": "http://example.com"},
					}))

					Expect(versions).To(Equal([]atc.Version{
						{"version": "1"},
						{"version": "2"},
						{"version": "3"},
					}))

				})