Beispiel #1
0
				configPath = filepath.Join(cwd, "..", "..", "..", "fixtures", "config", "outdated-config", ".cf", "config.json")
			})

			It("returns a new empty config", func() {
				config = coreconfig.NewRepositoryFromFilepath(configPath, func(err error) {
					panic(err)
				})

				Expect(config.APIEndpoint()).To(Equal(""))
			})
		})
	})

	Describe("IsMinCLIVersion", func() {
		It("returns true when the actual version is BUILT_FROM_SOURCE", func() {
			Expect(config.IsMinCLIVersion("BUILT_FROM_SOURCE")).To(BeTrue())
		})

		It("returns true when the MinCLIVersion is empty", func() {
			config.SetMinCLIVersion("")
			Expect(config.IsMinCLIVersion("1.2.3")).To(BeTrue())
		})

		It("returns false when the actual version is less than the MinCLIVersion", func() {
			actualVersion := "1.2.3+abc123"
			minCLIVersion := "1.2.4"
			config.SetMinCLIVersion(minCLIVersion)
			Expect(config.IsMinCLIVersion(actualVersion)).To(BeFalse())
		})

		It("returns true when the actual version is equal to the MinCLIVersion", func() {