Ejemplo n.º 1
0
		expectedBulkInfo := map[string]garden.ContainerInfoEntry{
			"handle1": garden.ContainerInfoEntry{
				Info: garden.ContainerInfo{
					State: "container1State",
				},
			},
			"handle2": garden.ContainerInfoEntry{
				Info: garden.ContainerInfo{
					State: "container1State",
				},
			},
		}
		handles := []string{"handle1", "handle2"}

		It("gets info for the requested containers", func() {
			fakeConnection.BulkInfoReturns(expectedBulkInfo, nil)

			bulkInfo, err := client.BulkInfo(handles)
			Ω(err).ShouldNot(HaveOccurred())

			Ω(fakeConnection.BulkInfoCallCount()).Should(Equal(1))
			Ω(fakeConnection.BulkInfoArgsForCall(0)).Should(Equal(handles))
			Ω(bulkInfo).Should(Equal(expectedBulkInfo))
		})

		Context("when there is a error with the connection", func() {
			expectedBulkInfo := map[string]garden.ContainerInfoEntry{}

			BeforeEach(func() {
				fakeConnection.BulkInfoReturns(expectedBulkInfo, errors.New("Oh noes!"))
			})