name, appPorts := fakeManifest.AppPortsArgsForCall(0) Expect(name).To(Equal("app-name")) Expect(appPorts).To(Equal([]int{1111, 2222})) }) }) Context("when app ports are not specified", func() { It("does not set app ports", func() { Expect(runCLIErr).NotTo(HaveOccurred()) Expect(fakeManifest.AppPortsCallCount()).To(Equal(0)) }) }) It("tries to get stacks", func() { Expect(runCLIErr).NotTo(HaveOccurred()) Expect(stackRepo.FindByGUIDCallCount()).To(Equal(1)) Expect(stackRepo.FindByGUIDArgsForCall(0)).To(Equal("the-stack-guid")) }) Context("when getting stacks succeeds", func() { BeforeEach(func() { stackRepo.FindByGUIDReturns(models.Stack{ GUID: "the-stack-guid", Name: "the-stack-name", }, nil) }) It("sets the stacks", func() { Expect(runCLIErr).NotTo(HaveOccurred()) Expect(fakeManifest.StackCallCount()).To(Equal(1)) name, stackName := fakeManifest.StackArgsForCall(0)