test_helpers.ExecuteCommandWithArgs(visualizeCommand, []string{"--graphical", "--rate=200ms"}) Consistently(outputBuffer).ShouldNot(test_helpers.Say("Distribution")) Expect(fakeGraphicalVisualizer.PrintDistributionChartCallCount()).To(Equal(1)) duration, err := time.ParseDuration("200ms") Expect(err).NotTo(HaveOccurred()) Expect(fakeGraphicalVisualizer.PrintDistributionChartArgsForCall(0)).To(Equal(duration)) }) }) }) }) Describe("StatusCommand", func() { var ( statusCommand cli.Command sampleAppInfo app_examiner.AppInfo ) epochTime := int64(401120627) roundTime := func(now, since time.Time) string { uptime := (now.Sub(since) - (now.Sub(since) % time.Second)).String() return uptime } BeforeEach(func() { commandFactory := command_factory.NewAppExaminerCommandFactory(fakeAppExaminer, terminalUI, fakeTerm, fakeClock, fakeExitHandler, nil, fakeTaskExaminer, systemDomain) statusCommand = commandFactory.MakeStatusCommand() sampleAppInfo = app_examiner.AppInfo{ ProcessGuid: "wompy-app", DesiredInstances: 12,
test_helpers.ExecuteCommandWithArgs(visualizeCommand, []string{"--graphical", "--rate=200ms"}) Consistently(outputBuffer).ShouldNot(test_helpers.Say("Distribution")) Expect(fakeGraphicalVisualizer.PrintDistributionChartCallCount()).To(Equal(1)) duration, err := time.ParseDuration("200ms") Expect(err).NotTo(HaveOccurred()) Expect(fakeGraphicalVisualizer.PrintDistributionChartArgsForCall(0)).To(Equal(duration)) }) }) }) }) Describe("StatusCommand", func() { var ( statusCommand cli.Command sampleAppInfo app_examiner.AppInfo ) epochTime := int64(401120627) roundTime := func(now, since time.Time) string { uptime := (now.Sub(since) - (now.Sub(since) % time.Second)).String() return uptime } BeforeEach(func() { commandFactory := command_factory.NewAppExaminerCommandFactory(fakeAppExaminer, terminalUI, fakeTerm, fakeClock, fakeExitHandler, nil, fakeTaskExaminer, systemDomain) statusCommand = commandFactory.MakeStatusCommand() sampleAppInfo = app_examiner.AppInfo{ ProcessGuid: "wompy-app", RootFS: "preloaded:rootfs2",