BeforeEach(func() { fakeConnection.InfoReturns(garden.ContainerInfo{}, disaster) }) It("returns the error", func() { _, err := container.Info() Ω(err).Should(Equal(disaster)) }) }) }) Describe("Properties", func() { Context("when getting properties succeeds", func() { BeforeEach(func() { fakeConnection.PropertiesReturns(garden.Properties{"Foo": "bar"}, nil) }) It("returns the properties map", func() { result, err := container.Properties() Ω(err).ShouldNot(HaveOccurred()) Ω(result).Should(Equal(garden.Properties{"Foo": "bar"})) }) }) Context("when getting properties fails", func() { disaster := errors.New("oh no!") BeforeEach(func() { fakeConnection.PropertiesReturns(nil, disaster) })