sb, err := sandboxRepo.Get("some-other-sandbox-name") Expect(err).NotTo(HaveOccurred()) Expect(sb).To(Equal(otherSbox)) }) Context("when the sandbox does not exist", func() { It("returns a NotFoundError", func() { err := sandboxRepo.Destroy("some-non-existent-name") Expect(err).To(BeIdenticalTo(sandbox.NotFoundError)) }) }) Context("when teardown fails", func() { BeforeEach(func() { sbox.TeardownReturns(errors.New("papaya")) }) It("returns a meaningful error", func() { err := sandboxRepo.Destroy("some-sandbox-name") Expect(err).To(MatchError("teardown: papaya")) }) It("does not remove the sandbox entry", func() { sandboxRepo.Destroy("some-sandbox-name") Expect(sbox.TeardownCallCount()).To(Equal(1)) Expect(sandboxRepo.Sandboxes).To(HaveKey("some-sandbox-name")) }) It("does not destroy the namespace", func() {