} It("returns the limits returned by the backend", func() { fakeContainer.CurrentDiskLimitsReturns(currentLimits, nil) limits, err := container.CurrentDiskLimits() Ω(err).ShouldNot(HaveOccurred()) Ω(limits).Should(Equal(currentLimits)) }) It("does not change the disk limit", func() { _, err := container.CurrentDiskLimits() Ω(err).ShouldNot(HaveOccurred()) Ω(fakeContainer.LimitDiskCallCount()).Should(BeZero()) }) itFailsWhenTheContainerIsNotFound(func() error { _, err := container.CurrentDiskLimits() return err }) Context("when getting the current disk limits fails", func() { BeforeEach(func() { fakeContainer.CurrentDiskLimitsReturns(garden.DiskLimits{}, errors.New("oh no!")) }) It("fails", func() { _, err := container.CurrentDiskLimits() Ω(err).Should(HaveOccurred())