Exemplo n.º 1
0
		handle := "suitcase"

		limits := garden.MemoryLimits{
			LimitInBytes: 234,
		}

		var gotLimits garden.MemoryLimits

		itRetries(func() error {
			var err error
			gotLimits, err = conn.LimitMemory(handle, limits)
			return err
		}, func(err error) {
			innerConnection.LimitMemoryReturns(limits, err)
		}, func() int {
			return innerConnection.LimitMemoryCallCount()
		}, func() {
			It("calls through to garden", func() {
				Ω(innerConnection.LimitMemoryCallCount()).Should(Equal(1))

				calledHandle, calledLimits := innerConnection.LimitMemoryArgsForCall(0)
				Ω(calledHandle).Should(Equal(handle))
				Ω(calledLimits).Should(Equal(limits))
			})

			It("returns the limits", func() {
				Ω(gotLimits).Should(Equal(limits))
			})
		})
	})
		handle := "suitcase"

		limits := garden.MemoryLimits{
			LimitInBytes: 234,
		}

		var gotLimits garden.MemoryLimits

		itRetries(func() error {
			var err error
			gotLimits, err = conn.LimitMemory(handle, limits)
			return err
		}, func(err error) {
			innerConnection.LimitMemoryReturns(limits, err)
		}, func() int {
			return innerConnection.LimitMemoryCallCount()
		}, func() {
			It("calls through to garden", func() {
				Expect(innerConnection.LimitMemoryCallCount()).To(Equal(1))

				calledHandle, calledLimits := innerConnection.LimitMemoryArgsForCall(0)
				Expect(calledHandle).To(Equal(handle))
				Expect(calledLimits).To(Equal(limits))
			})

			It("returns the limits", func() {
				Expect(gotLimits).To(Equal(limits))
			})
		})
	})