github.com/cloudfoundry/cli@v7.1.0+incompatible/actor/actionerror/package_not_found_in_app_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("PackageNotFoundInAppError", func() { 10 Describe("Error", func() { 11 When("package GUID and app name are specified", func() { 12 It("returns an error message with both", func() { 13 err := actionerror.PackageNotFoundInAppError{ 14 GUID: "some-package-guid", 15 AppName: "zora", 16 } 17 Expect(err.Error()).To( 18 Equal("Package with guid 'some-package-guid' not found in app 'zora'.")) 19 }) 20 }) 21 When("the app name is specified and package GUID is not", func() { 22 It("returns an error message with the app name that is missing packages", func() { 23 err := actionerror.PackageNotFoundInAppError{ 24 AppName: "dora", 25 } 26 Expect(err.Error()).To(Equal("Package not found in app 'dora'.")) 27 }) 28 }) 29 When("neither app name nor package GUID is specified", func() { 30 It("returns a generic error message for the missing package", func() { 31 err := actionerror.PackageNotFoundInAppError{} 32 Expect(err.Error()).To(Equal("Package not found.")) 33 }) 34 }) 35 }) 36 })