Exemple #1
0
				},
			}
		})

		It("reconnects", func() {
			_, err := client.Create(warden.ContainerSpec{})
			Ω(err).ShouldNot(HaveOccurred())

			Ω(fakeConnection.Created()).Should(HaveLen(1))

			_, err = client.Create(warden.ContainerSpec{})
			Ω(err).ShouldNot(HaveOccurred())

			Ω(fakeConnection.Created()).Should(HaveLen(2))

			fakeConnection.NotifyDisconnected()

			_, err = client.Create(warden.ContainerSpec{})
			Ω(err).ShouldNot(HaveOccurred())

			Ω(reconnectedConnection.Created()).Should(HaveLen(1))
		})
	})

	Describe("Capacity", func() {
		BeforeEach(func() {
			fakeConnection.WhenGettingCapacity = func() (warden.Capacity, error) {
				return warden.Capacity{
					MemoryInBytes: 1111,
					DiskInBytes:   2222,
					MaxContainers: 42,