Exemple #1
0
			})
			Ω(err).ShouldNot(HaveOccurred())

			Ω(fakeConnection.LimitedDisk("some-handle")).Should(ContainElement(
				warden.DiskLimits{
					ByteLimit: 1,
				},
			))
		})

		Context("when the request fails", func() {
			disaster := errors.New("oh no!")

			BeforeEach(func() {
				fakeConnection.WhenLimitingDisk = func(handle string, limits warden.DiskLimits) (warden.DiskLimits, error) {
					return warden.DiskLimits{}, disaster
				}
			})

			It("returns the error", func() {
				err := container.LimitDisk(warden.DiskLimits{})
				Ω(err).Should(Equal(disaster))
			})
		})
	})

	Describe("LimitMemory", func() {
		It("sends a limit bandwidth request", func() {
			err := container.LimitMemory(warden.MemoryLimits{
				LimitInBytes: 1,
			})