本文整理匯總了Golang中code/cloudfoundry/org/cli/cf/configuration/coreconfig.ReadWriter.SetMinCLIVersion方法的典型用法代碼示例。如果您正苦於以下問題:Golang ReadWriter.SetMinCLIVersion方法的具體用法?Golang ReadWriter.SetMinCLIVersion怎麽用?Golang ReadWriter.SetMinCLIVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類code/cloudfoundry/org/cli/cf/configuration/coreconfig.ReadWriter
的用法示例。
在下文中一共展示了ReadWriter.SetMinCLIVersion方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
})
})
})
Describe("NotifyUpdateIfNeeded", func() {
var (
output []string
config coreconfig.ReadWriter
)
BeforeEach(func() {
config = testconfig.NewRepository()
})
It("Prints a notification to user if current version < min cli version", func() {
config.SetMinCLIVersion("6.0.0")
config.SetMinRecommendedCLIVersion("6.5.0")
config.SetAPIVersion("2.15.1")
cf.Version = "5.0.0"
output = io_helpers.CaptureOutput(func() {
ui := NewUI(os.Stdin, os.Stdout, NewTeePrinter(os.Stdout), fakeLogger)
ui.NotifyUpdateIfNeeded(config)
})
Expect(output).To(ContainSubstrings([]string{"Cloud Foundry API version",
"requires CLI version 6.0.0",
"You are currently on version 5.0.0",
"To upgrade your CLI, please visit: https://github.com/cloudfoundry/cli#downloads",
}))
})