コード例 #1
0
ファイル: marketplace_test.go プロジェクト: vframbach/cli
)

var _ = Describe("marketplace command", func() {
	var ui *testterm.FakeUI
	var requirementsFactory *testreq.FakeReqFactory
	var config core_config.Repository
	var serviceBuilder *testapi.FakeServiceBuilder
	var fakeServiceOfferings []models.ServiceOffering
	var serviceWithAPaidPlan models.ServiceOffering
	var service2 models.ServiceOffering
	var deps command_registry.Dependency

	updateCommandDependency := func(pluginCall bool) {
		deps.Ui = ui
		deps.Config = config
		deps.ServiceBuilder = serviceBuilder
		command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("marketplace").SetDependency(deps, pluginCall))
	}

	BeforeEach(func() {
		serviceBuilder = &testapi.FakeServiceBuilder{}
		ui = &testterm.FakeUI{}
		requirementsFactory = &testreq.FakeReqFactory{ApiEndpointSuccess: true}

		serviceWithAPaidPlan = models.ServiceOffering{
			Plans: []models.ServicePlanFields{
				models.ServicePlanFields{Name: "service-plan-a", Description: "service-plan-a description", Free: true},
				models.ServicePlanFields{Name: "service-plan-b", Description: "service-plan-b description", Free: false},
			},
			ServiceOfferingFields: models.ServiceOfferingFields{
				Label:       "zzz-my-service-offering",