github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/actor/sharedaction/is_org_targeted_test.go (about) 1 package sharedaction_test 2 3 import ( 4 . "code.cloudfoundry.org/cli/actor/sharedaction" 5 "code.cloudfoundry.org/cli/actor/sharedaction/sharedactionfakes" 6 . "github.com/onsi/ginkgo" 7 . "github.com/onsi/gomega" 8 ) 9 10 var _ = Describe("IsOrgTargeted", func() { 11 var ( 12 actor *Actor 13 fakeConfig *sharedactionfakes.FakeConfig 14 ) 15 16 BeforeEach(func() { 17 fakeConfig = new(sharedactionfakes.FakeConfig) 18 actor = NewActor(fakeConfig) 19 }) 20 21 When("the config has an org targeted", func() { 22 BeforeEach(func() { 23 fakeConfig.HasTargetedOrganizationReturns(true) 24 }) 25 26 It("returns true", func() { 27 Expect(actor.IsOrgTargeted()).To(BeTrue()) 28 }) 29 }) 30 31 When("the config does not have an org targeted", func() { 32 BeforeEach(func() { 33 fakeConfig.HasTargetedOrganizationReturns(false) 34 }) 35 36 It("returns false", func() { 37 Expect(actor.IsOrgTargeted()).To(BeFalse()) 38 }) 39 }) 40 })