"cool-web-app", "superfun/app", "--", "/start-me-please", } doneChan := test_helpers.AsyncExecuteCommandWithArgs(createCommand, args) Eventually(outputBuffer).Should(test_helpers.SayLine("Creating App: cool-web-app")) Expect(fakeTailedLogsOutputter.OutputTailedLogsCallCount()).To(Equal(1)) Expect(fakeTailedLogsOutputter.OutputTailedLogsArgsForCall(0)).To(Equal("cool-web-app")) Expect(fakeAppExaminer.RunningAppInstancesInfoCallCount()).To(Equal(1)) Expect(fakeAppExaminer.RunningAppInstancesInfoArgsForCall(0)).To(Equal("cool-web-app")) fakeClock.IncrementBySeconds(1) Expect(fakeTailedLogsOutputter.StopOutputtingCallCount()).To(Equal(0)) fakeAppExaminer.RunningAppInstancesInfoReturns(9, false, nil) fakeClock.IncrementBySeconds(1) Expect(doneChan).ShouldNot(BeClosed()) Expect(fakeTailedLogsOutputter.StopOutputtingCallCount()).To(Equal(0)) fakeAppExaminer.RunningAppInstancesInfoReturns(10, false, nil) fakeClock.IncrementBySeconds(1) Eventually(doneChan).Should(BeClosed()) Expect(outputBuffer).To(test_helpers.SayNewLine()) Expect(outputBuffer).To(test_helpers.SayLine(colors.Green("cool-web-app is now running."))) Expect(outputBuffer).To(test_helpers.SayLine("App is reachable at:"))
Eventually(bbsClient.DesiredLRPSchedulingInfosCallCount).Should(Equal(1)) Consistently(table.SwapCallCount).Should(Equal(0)) atomic.StoreInt32(&returnError, 0) syncEvents.Sync <- struct{}{} Eventually(table.SwapCallCount).Should(Equal(1)) Expect(bbsClient.DesiredLRPSchedulingInfosCallCount()).To(Equal(2)) }) }) }) Context("when syncing ends", func() { BeforeEach(func() { bbsClient.ActualLRPGroupsStub = func(f models.ActualLRPFilter) ([]*models.ActualLRPGroup, error) { clock.IncrementBySeconds(1) return []*models.ActualLRPGroup{ actualLRPGroup1, actualLRPGroup2, }, nil } }) JustBeforeEach(func() { syncEvents.Sync <- struct{}{} }) It("swaps the tables", func() { Eventually(table.SwapCallCount).Should(Equal(1)) })