disaster := errors.New("oh no!") fakeQuotaManager.SetLimitsReturns(disaster) err := container.LimitDisk(limits) Expect(err).To(Equal(disaster)) }) }) }) Describe("Getting the current disk limits", func() { It("returns the disk limits", func() { limits := garden.DiskLimits{ ByteHard: 1234567, } fakeQuotaManager.GetLimitsReturns(limits, nil) receivedLimits, err := container.CurrentDiskLimits() Expect(err).ToNot(HaveOccurred()) Expect(receivedLimits).To(Equal(limits)) }) Context("when getting the limit fails", func() { disaster := errors.New("oh no!") JustBeforeEach(func() { fakeQuotaManager.GetLimitsReturns(garden.DiskLimits{}, disaster) }) It("returns the error", func() { limits, err := container.CurrentDiskLimits()