Exemple #1
0
	testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
	testterm "github.com/cloudfoundry/cli/testhelpers/terminal"

	clipr "github.com/cloudfoundry-incubator/cli-plugin-repo/web"

	"github.com/cloudfoundry/cli/cf/flags"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("repo-plugins", func() {
	var (
		ui                  *testterm.FakeUI
		config              coreconfig.Repository
		requirementsFactory *requirementsfakes.FakeFactory
		fakePluginRepo      *pluginrepofakes.FakePluginRepo
		deps                commandregistry.Dependency
		cmd                 *pluginrepo.RepoPlugins
		flagContext         flags.FlagContext
	)

	BeforeEach(func() {
		fakePluginRepo = new(pluginrepofakes.FakePluginRepo)
		ui = &testterm.FakeUI{}
		requirementsFactory = new(requirementsfakes.FakeFactory)
		config = testconfig.NewRepositoryWithDefaults()

		deps = commandregistry.Dependency{
			UI:         ui,
			Config:     config,
			PluginRepo: fakePluginRepo,
Exemple #2
0
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Install", func() {
	var (
		ui                  *testterm.FakeUI
		requirementsFactory *testreq.FakeReqFactory
		config              coreconfig.Repository
		pluginConfig        *pluginconfigfakes.FakePluginConfiguration
		fakePluginRepo      *pluginrepofakes.FakePluginRepo
		fakeChecksum        *utilsfakes.FakeSha1Checksum

		pluginFile *os.File
		homeDir    string
		pluginDir  string
		curDir     string

		test_1                    string
		test_2                    string
		test_curDir               string
		test_with_help            string
		test_with_orgs            string
		test_with_orgs_short_name string
		aliasConflicts            string
		deps                      commandregistry.Dependency
	)

	updateCommandDependency := func(pluginCall bool) {
		deps.UI = ui
		deps.Config = config
		deps.PluginConfig = pluginConfig