コード例 #1
0
	})

	Context("when getting the sandbox fails", func() {
		BeforeEach(func() {
			sandboxRepository.GetReturns(nil, errors.New("welp"))
		})

		It("returns a meaningful error", func() {
			err := moveLink.Execute(context)
			Expect(err).To(MatchError("get sandbox: welp"))
		})
	})

	Context("when moving the link fails", func() {
		BeforeEach(func() {
			linkFactory.SetNamespaceReturns(errors.New("welp"))
		})

		It("returns a meaningful error", func() {
			err := moveLink.Execute(context)
			Expect(err).To(MatchError("move link: welp"))
		})
	})

	Describe("String", func() {
		It("describes itself", func() {
			Expect(moveLink.String()).To(Equal("ip link set dev link-name netns sandbox-name"))
		})
	})
})