BeforeEach(func() { commandFactory := droplet_runner_command_factory.NewDropletRunnerCommandFactory(appRunnerCommandFactory, fakeBlobStoreVerifier, fakeTaskExaminer, fakeDropletRunner, nil, fakeZipper, config) listDropletsCommand = commandFactory.MakeListDropletsCommand() fakeBlobStoreVerifier.VerifyReturns(true, nil) }) It("lists the droplets most recent first", func() { times := []time.Time{ time.Date(2014, 12, 31, 8, 22, 44, 0, time.Local), time.Date(2015, 6, 15, 16, 11, 33, 0, time.Local), } droplets := []droplet_runner.Droplet{ {Name: "drop-a", Created: times[0], Size: 789 * 1024 * 1024}, {Name: "drop-b", Created: times[1], Size: 456 * 1024}, } fakeDropletRunner.ListDropletsReturns(droplets, nil) test_helpers.ExecuteCommandWithArgs(listDropletsCommand, []string{}) Expect(fakeBlobStoreVerifier.VerifyCallCount()).To(Equal(1)) Expect(fakeBlobStoreVerifier.VerifyArgsForCall(0)).To(Equal(config)) Expect(outputBuffer).To(test_helpers.SayLine("Droplet\t\tCreated At\t\tSize")) Expect(outputBuffer).To(test_helpers.SayLine("drop-b\t\t06/15 16:11:33.00\t456K")) Expect(outputBuffer).To(test_helpers.SayLine("drop-a\t\t12/31 08:22:44.00\t789M")) }) It("doesn't print a time if Created is nil", func() { time := time.Date(2014, 12, 31, 14, 33, 52, 0, time.Local) droplets := []droplet_runner.Droplet{