Example #1
0
			Context("when the guid is already taken", func() {
				JustBeforeEach(func() {
					Expect(allocErr).NotTo(HaveOccurred())
					allocationErrorMap, allocErr = executorClient.AllocateContainers([]executor.Container{container})
				})

				It("returns an error", func() {
					Expect(allocErr).NotTo(HaveOccurred())
					Expect(allocationErrorMap[container.Guid]).To(Equal(executor.ErrContainerGuidNotAvailable.Error()))
				})
			})

			Context("when a guid is not specified", func() {
				BeforeEach(func() {
					container.Guid = ""
				})

				It("returns an error", func() {
					Expect(allocErr).NotTo(HaveOccurred())
					Expect(allocationErrorMap[container.Guid]).To(Equal(executor.ErrGuidNotSpecified.Error()))
				})
			})

			Context("when there is no room", func() {
				BeforeEach(func() {
					container.MemoryMB = 999999999999999
					container.DiskMB = 999999999999999
				})

				It("returns an error", func() {