Exemplo n.º 1
0
					fakeContainer.MetricsReturns(garden.Metrics{}, errors.New("o no"))
				})

				It("returns an error", func() {
					metrics, err := container.Metrics()
					Ω(err).Should(HaveOccurred())
					Ω(metrics).Should(Equal(garden.Metrics{}))
				})
			})
		})

		Describe("properties", func() {
			Describe("getting all", func() {
				Context("when getting the properties succeeds", func() {
					BeforeEach(func() {
						fakeContainer.GetPropertiesReturns(garden.Properties{"foo": "bar"}, nil)
					})

					It("returns the properties from the container", func() {
						value, err := container.GetProperties()
						Ω(err).ShouldNot(HaveOccurred())

						Ω(value).Should(Equal(garden.Properties{"foo": "bar"}))
					})

					itResetsGraceTimeWhenHandling(func() {
						_, err := container.GetProperties()
						Ω(err).ShouldNot(HaveOccurred())
					})

					itFailsWhenTheContainerIsNotFound(func() error {