}) Context("checking ltc target version", func() { BeforeEach(func() { fakeTargetVerifier.VerifyTargetReturns(true, true, nil) fakeBlobStoreVerifier.VerifyReturns(true, nil) fakeVersionManager.LatticeVersionReturns("some-version") }) It("should print warning and recommend sync if ltc version does not match server", func() { fakeVersionManager.LtcMatchesServerReturns(false, nil) test_helpers.ExecuteCommandWithArgs(targetCommand, []string{"target.com"}) Expect(fakeVersionManager.LtcMatchesServerCallCount()).To(Equal(1)) Expect(fakeVersionManager.LtcMatchesServerArgsForCall(0)).To(Equal("http://receptor.target.com")) Expect(outputBuffer).To(test_helpers.SayLine("WARNING: local ltc version (some-version) does not match target expected version.")) Expect(outputBuffer).To(test_helpers.SayLine("Run `ltc sync` to replace your local ltc command-line tool with your target cluster's expected version.")) }) It("should print warning and NOT recommend sync if ServerVersions endpoint fails", func() { fakeVersionManager.LtcMatchesServerReturns(false, errors.New("whoops")) test_helpers.ExecuteCommandWithArgs(targetCommand, []string{"target.com"}) Expect(fakeVersionManager.LtcMatchesServerCallCount()).To(Equal(1)) Expect(fakeVersionManager.LtcMatchesServerArgsForCall(0)).To(Equal("http://receptor.target.com")) Expect(outputBuffer).To(test_helpers.SayLine("WARNING: local ltc version (some-version) does not match target expected version.")) Expect(outputBuffer).NotTo(test_helpers.SayLine("Run `ltc sync` to replace your local ltc command-line tool with your target cluster's expected version."))