github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/integration/v7/isolated/config_test.go (about)

     1  package isolated
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/integration/helpers"
     5  	"code.cloudfoundry.org/cli/util/configv3"
     6  	. "github.com/onsi/ginkgo"
     7  	. "github.com/onsi/gomega"
     8  )
     9  
    10  var _ = Describe("Config", func() {
    11  	Describe("Version Management", func() {
    12  		It("reset config to default if version mismatch", func() {
    13  			helpers.SetConfig(func(config *configv3.Config) {
    14  				config.ConfigFile.ConfigVersion = configv3.CurrentConfigVersion - 1
    15  				config.ConfigFile.Target = "api.my-target"
    16  			})
    17  			helpers.CF("plugins")
    18  			config := helpers.GetConfig()
    19  			Expect(config.ConfigFile.ConfigVersion).To(Equal(configv3.CurrentConfigVersion))
    20  			Expect(config.ConfigFile.Target).To(Equal(""))
    21  		})
    22  	})
    23  })