예제 #1
0
				new(gfakes.FakeContainer),
				new(gfakes.FakeContainer),
			}

			containers <- []garden.Container{
				new(gfakes.FakeContainer),
				new(gfakes.FakeContainer),
				new(gfakes.FakeContainer),
				new(gfakes.FakeContainer),
				new(gfakes.FakeContainer),
			}

			close(containers)

			fakeGardenClient.ContainersStub = func(garden.Properties) ([]garden.Container, error) {
				return <-containers, nil
			}
		})

		It("immediately registers", func() {
			Ω(registrations).Should(Receive(Equal(registration{
				worker: expectedWorker,
				ttl:    2 * interval,
			})))
		})

		Context("when the interval passes after the initial registration", func() {
			JustBeforeEach(func() {
				Ω(registrations).Should(Receive(Equal(registration{
					worker: expectedWorker,
					ttl:    2 * interval,