github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/actor/actionerror/duplicate_service_plan_error_test.go (about)

     1  package actionerror_test
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/actor/actionerror"
     5  	. "github.com/onsi/ginkgo"
     6  	. "github.com/onsi/gomega"
     7  )
     8  
     9  var _ = Describe("DuplicateServicePlanError", func() {
    10  	Describe("Error", func() {
    11  		When("Only Name is specified", func() {
    12  			It("returns the right error message", func() {
    13  				err := actionerror.DuplicateServicePlanError{
    14  					Name: "some-service-plan-name",
    15  				}
    16  				Expect(err.Error()).To(
    17  					Equal("Service plan 'some-service-plan-name' is provided by multiple service offerings. Specify an offering by using the '-e' flag."))
    18  			})
    19  		})
    20  		When("Name and ServiceOfferingName are specified", func() {
    21  			It("returns the right error message", func() {
    22  				err := actionerror.DuplicateServicePlanError{
    23  					Name:                "some-service-plan-name",
    24  					ServiceOfferingName: "some-service-offering-name",
    25  				}
    26  				Expect(err.Error()).To(
    27  					Equal("Service plan 'some-service-plan-name' is provided by multiple service offerings. Service offering 'some-service-offering-name' is provided by multiple service brokers. Specify a broker name by using the '-b' flag."))
    28  			})
    29  		})
    30  		When("Name and ServiceBrokerName are specified", func() {
    31  			It("returns the right error message", func() {
    32  				err := actionerror.DuplicateServicePlanError{
    33  					Name:              "some-service-plan-name",
    34  					ServiceBrokerName: "some-broker-name",
    35  				}
    36  				Expect(err.Error()).To(
    37  					Equal("Service plan 'some-service-plan-name' is provided by multiple service offerings. Specify an offering by using the '-e' flag."))
    38  			})
    39  		})
    40  	})
    41  })