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

			Ω(fakeConnection.LimitedBandwidth("some-handle")).Should(ContainElement(
				warden.BandwidthLimits{
					RateInBytesPerSecond: 1,
				},
			))
		})

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

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

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

	Describe("LimitCPU", func() {
		It("sends a limit cpu request", func() {
			err := container.LimitCPU(warden.CPULimits{
				LimitInShares: 1,
			})