}) It("should not destroy the key space of the property manager", func() { err := gdnr.Destroy("some-handle") Expect(err).To(HaveOccurred()) Expect(propertyManager.DestroyKeySpaceCallCount()).To(Equal(0)) }) }) }) Describe("getting capacity", func() { BeforeEach(func() { sysinfoProvider.TotalMemoryReturns(999, nil) sysinfoProvider.TotalDiskReturns(888, nil) networker.CapacityReturns(1000) }) It("returns capacity", func() { capacity, err := gdnr.Capacity() Expect(err).NotTo(HaveOccurred()) Expect(capacity.MemoryInBytes).To(BeEquivalentTo(999)) Expect(capacity.DiskInBytes).To(BeEquivalentTo(888)) Expect(capacity.MaxContainers).To(BeEquivalentTo(1000)) }) Context("when getting the total memory fails", func() { BeforeEach(func() { sysinfoProvider.TotalMemoryReturns(0, errors.New("whelp")) })