github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/actor/sharedaction/is_space_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("IsSpaceTargeted", 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 a space targeted", func() {
    22  		BeforeEach(func() {
    23  			fakeConfig.HasTargetedSpaceReturns(true)
    24  		})
    25  
    26  		It("returns true", func() {
    27  			Expect(actor.IsSpaceTargeted()).To(BeTrue())
    28  		})
    29  	})
    30  
    31  	When("the config does not have a space targeted", func() {
    32  		BeforeEach(func() {
    33  			fakeConfig.HasTargetedSpaceReturns(false)
    34  		})
    35  
    36  		It("returns false", func() {
    37  			Expect(actor.IsSpaceTargeted()).To(BeFalse())
    38  		})
    39  	})
    40  })