예제 #1
0
	Describe("Create", func() {
		spec := garden.ContainerSpec{
			RootFSPath: "/dev/mouse",
		}

		var gotHandle string

		itRetries(func() error {
			var err error
			gotHandle, err = conn.Create(spec)
			return err
		}, func(err error) {
			innerConnection.CreateReturns("bach", err)
		}, func() int {
			return innerConnection.CreateCallCount()
		}, func() {
			It("calls through to garden", func() {
				Ω(innerConnection.CreateCallCount()).Should(Equal(1))

				calledSpec := innerConnection.CreateArgsForCall(0)
				Ω(calledSpec).Should(Equal(spec))
			})

			It("returns the container handle", func() {
				Ω(gotHandle).Should(Equal("bach"))
			})
		})
	})

	Describe("Destroy", func() {
	Describe("Create", func() {
		spec := garden.ContainerSpec{
			RootFSPath: "/dev/mouse",
		}

		var gotHandle string

		itRetries(func() error {
			var err error
			gotHandle, err = conn.Create(spec)
			return err
		}, func(err error) {
			innerConnection.CreateReturns("bach", err)
		}, func() int {
			return innerConnection.CreateCallCount()
		}, func() {
			It("calls through to garden", func() {
				Expect(innerConnection.CreateCallCount()).To(Equal(1))

				calledSpec := innerConnection.CreateArgsForCall(0)
				Expect(calledSpec).To(Equal(spec))
			})

			It("returns the container handle", func() {
				Expect(gotHandle).To(Equal("bach"))
			})
		})
	})

	Describe("Destroy", func() {