Esempio n. 1
0
					BeforeEach(func() {
						fakeContainer.GetPropertiesReturns(nil, errors.New("o no"))
					})

					It("returns an error", func() {
						properties, err := container.GetProperties()
						Ω(err).Should(HaveOccurred())
						Ω(properties).Should(BeEmpty())
					})
				})
			})

			Describe("getting", func() {
				Context("when getting the property succeeds", func() {
					BeforeEach(func() {
						fakeContainer.GetPropertyReturns("some-property-value", nil)
					})

					It("returns the property from the container", func() {
						value, err := container.GetProperty("some-property")
						Ω(err).ShouldNot(HaveOccurred())

						Ω(value).Should(Equal("some-property-value"))

						Ω(fakeContainer.GetPropertyCallCount()).Should(Equal(1))

						name := fakeContainer.GetPropertyArgsForCall(0)
						Ω(name).Should(Equal("some-property"))
					})

					itResetsGraceTimeWhenHandling(func() {