Exemplo n.º 1
0
			Expect(outputBuffer).To(test_helpers.SayLine("CF routing release version: v220"))
			Expect(outputBuffer).To(test_helpers.SayLine("Diego release version: v221"))
			Expect(outputBuffer).To(test_helpers.SayLine("Garden linux release version: v222"))
			Expect(outputBuffer).To(test_helpers.SayLine("Lattice release version: v223"))
			Expect(outputBuffer).To(test_helpers.SayLine("Lattice release image version: v224"))
			Expect(outputBuffer).To(test_helpers.SayLine("Receptor version: v226"))
		})

		Context("when the version manager returns an error", func() {
			It("should print an error", func() {
				fakeVersionManager.ServerVersionsReturns(version.ServerVersions{}, errors.New("failed"))

				test_helpers.ExecuteCommandWithArgs(versionCommand, []string{})

				Expect(outputBuffer).To(test_helpers.SayLine("Error: failed"))
				Expect(fakeVersionManager.ServerVersionsCallCount()).To(Equal(1))
				Expect(fakeExitHandler.ExitCalledWith).To(Equal([]int{exit_codes.CommandFailed}))
			})
		})
	})

	Describe("SyncCommand", func() {
		var syncCommand cli.Command

		BeforeEach(func() {
			syncCommand = commandFactory.MakeSyncCommand()
		})

		It("should sync ltc", func() {
			test_helpers.ExecuteCommandWithArgs(syncCommand, []string{})