Beispiel #1
0
					return nil
				})
			})

			It("returns the error and no limits", func() {
				err := container.LimitMemory(garden.MemoryLimits{
					LimitInBytes: 102400,
				})

				Expect(err).To(Equal(disaster))
			})
		})

		Context("when starting the oom notifier fails", func() {
			BeforeEach(func() {
				fakeOomWatcher.WatchReturns(errors.New("banana"))
			})

			It("returns the error", func() {
				err := container.LimitMemory(garden.MemoryLimits{
					LimitInBytes: 102400,
				})

				Expect(err).To(MatchError("banana"))
			})
		})
	})

	Describe("Getting the current memory limit", func() {
		It("returns the limited memory", func() {
			fakeCgroups.WhenGetting("memory", "memory.limit_in_bytes", func() (string, error) {