go apiClient.Destroy("some-handle") <-destroying err := apiClient.Destroy("some-handle") Ω(err).Should(HaveOccurred()) Ω(serverBackend.DestroyCallCount()).Should(Equal(1)) }) }) Context("when the container cannot be found", func() { var theError = garden.ContainerNotFoundError{"some-handle"} BeforeEach(func() { serverBackend.DestroyReturns(theError) }) It("returns an ContainerNotFoundError", func() { err := apiClient.Destroy("some-handle") Ω(err).Should(MatchError(garden.ContainerNotFoundError{"some-handle"})) }) }) Context("when destroying the container fails", func() { var theError = errors.New("o no") BeforeEach(func() { serverBackend.DestroyReturns(theError) })