Example #1
0
	}

	Context("when using the default CF-Community repo", func() {
		BeforeEach(func() {
			config.SetPluginRepo(models.PluginRepo{
				Name: "cf",
				URL:  "http://plugins.cloudfoundry.org",
			})
		})

		It("uses https when pointing to plugins.cloudfoundry.org", func() {
			err := callRepoPlugins()
			Expect(err).NotTo(HaveOccurred())

			Expect(fakePluginRepo.GetPluginsCallCount()).To(Equal(1))
			Expect(fakePluginRepo.GetPluginsArgsForCall(0)[0].Name).To(Equal("cf"))
			Expect(fakePluginRepo.GetPluginsArgsForCall(0)[0].URL).To(Equal("https://plugins.cloudfoundry.org"))
			Expect(len(fakePluginRepo.GetPluginsArgsForCall(0))).To(Equal(1))
		})
	})

	Context("when using other plugin repos", func() {
		BeforeEach(func() {
			config.SetPluginRepo(models.PluginRepo{
				Name: "repo1",
				URL:  "",
			})

			config.SetPluginRepo(models.PluginRepo{
				Name: "repo2",
				URL:  "",