Example #1
0
									new(gfakes.FakeContainer),
								}, nil
							}

							stubs <- func() ([]garden.Container, error) {
								return nil, errors.New("garden was weeded")
							}

							stubs <- func() ([]garden.Container, error) {
								return []garden.Container{
									new(gfakes.FakeContainer),
								}, nil
							}

							fakeBackend.ContainersStub = func(garden.Properties) ([]garden.Container, error) {
								return (<-stubs)()
							}
						})

						JustBeforeEach(func() {
							err := json.NewEncoder(sshStdin).Encode(workerPayload)
							Ω(err).ShouldNot(HaveOccurred())
						})

						It("continuously registers it with the ATC as long as it works", func() {
							expectedWorkerPayload := workerPayload

							expectedWorkerPayload.ActiveContainers = 3

							a := time.Now()
							Ω(<-registered).Should(Equal(registration{