コード例 #1
0
ファイル: api_test.go プロジェクト: GABONIA/cli
				[]string{"TIP", "--skip-ssl-validation"},
			))
		})
	})

	Context("when the user does not provide an endpoint", func() {
		Context("when the endpoint is set in the config", func() {
			var (
				ui                  *testterm.FakeUI
				requirementsFactory *testreq.FakeReqFactory
			)

			BeforeEach(func() {
				config.SetApiEndpoint("https://api.run.pivotal.io")
				config.SetApiVersion("2.0")
				config.SetSSLDisabled(true)

				ui = new(testterm.FakeUI)
				requirementsFactory = &testreq.FakeReqFactory{}
			})

			JustBeforeEach(func() {
				testcmd.RunCommand(NewApi(ui, config, endpointRepo), []string{}, requirementsFactory)
			})

			It("prints out the api endpoint", func() {
				Expect(ui.Outputs).To(ContainSubstrings([]string{"https://api.run.pivotal.io", "2.0"}))
			})

			It("should not change the SSL setting in the config", func() {
				Expect(config.IsSSLDisabled()).To(BeTrue())