Exemple #1
0
		container, err = client.Create(warden.ContainerSpec{})
		Ω(err).ShouldNot(HaveOccurred())
	})

	Describe("Handle", func() {
		It("returns the container's handle", func() {
			Ω(container.Handle()).Should(Equal("some-handle"))
		})
	})

	Describe("Stop", func() {
		It("sends a stop request", func() {
			err := container.Stop(true)
			Ω(err).ShouldNot(HaveOccurred())

			Ω(fakeConnection.Stopped("some-handle")).Should(ContainElement(
				fake_connection.StopSpec{
					Background: false,
					Kill:       true,
				},
			))
		})

		Context("when stopping fails", func() {
			disaster := errors.New("oh no!")

			BeforeEach(func() {
				fakeConnection.WhenStopping = func(handle string, background, kill bool) error {
					return disaster
				}
			})