コード例 #1
0
	Describe("List", func() {
		properties := garden.Properties{
			"A": "B",
		}

		var gotHandles []string

		itRetries(func() error {
			var err error
			gotHandles, err = conn.List(properties)
			return err
		}, func(err error) {
			innerConnection.ListReturns([]string{"a", "b"}, err)
		}, func() int {
			return innerConnection.ListCallCount()
		}, func() {
			It("calls through to garden", func() {
				Ω(innerConnection.ListCallCount()).Should(Equal(1))

				listedProperties := innerConnection.ListArgsForCall(0)
				Ω(listedProperties).Should(Equal(properties))
			})

			It("returns the handles", func() {
				Ω(gotHandles).Should(Equal([]string{"a", "b"}))
			})
		})
	})

	Describe("Info", func() {
コード例 #2
0
	Describe("List", func() {
		properties := garden.Properties{
			"A": "B",
		}

		var gotHandles []string

		itRetries(func() error {
			var err error
			gotHandles, err = conn.List(properties)
			return err
		}, func(err error) {
			innerConnection.ListReturns([]string{"a", "b"}, err)
		}, func() int {
			return innerConnection.ListCallCount()
		}, func() {
			It("calls through to garden", func() {
				Expect(innerConnection.ListCallCount()).To(Equal(1))

				listedProperties := innerConnection.ListArgsForCall(0)
				Expect(listedProperties).To(Equal(properties))
			})

			It("returns the handles", func() {
				Expect(gotHandles).To(Equal([]string{"a", "b"}))
			})
		})
	})

	Describe("Info", func() {