return err } err := cleanupSandboxCommand.Execute(context) Expect(err).NotTo(HaveOccurred()) Expect(sandboxNS.ExecuteCallCount()).To(Equal(1)) Expect(linkFactory.DeleteLinkByNameArgsForCall(0)).To(Equal("some-vxlan")) }) It("destroys the sandbox", func() { err := cleanupSandboxCommand.Execute(context) Expect(err).NotTo(HaveOccurred()) Expect(sandboxRepo.DestroyCallCount()).To(Equal(1)) Expect(sandboxRepo.DestroyArgsForCall(0)).To(Equal("sandbox-name")) }) Context("when destroy fails with AlreadyDestroyedError", func() { BeforeEach(func() { sandboxRepo.DestroyReturns(sandbox.AlreadyDestroyedError) }) It("does not fail", func() { err := cleanupSandboxCommand.Execute(context) Expect(err).NotTo(HaveOccurred()) }) }) Context("when destroy fails with a NotFoundError", func() { BeforeEach(func() {