github.com/lukasheimann/cloudfoundrycli@v7.1.0+incompatible/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  })