github.com/chenbh/concourse/v6@v6.4.2/atc/policy/context_test.go (about)

     1  package policy_test
     2  
     3  import (
     4  	"context"
     5  	"github.com/chenbh/concourse/v6/atc/policy"
     6  
     7  	. "github.com/onsi/ginkgo"
     8  	. "github.com/onsi/gomega"
     9  )
    10  
    11  var _ = Context("PolicyContext", func() {
    12  	var ctx context.Context
    13  
    14  	BeforeEach(func() {
    15  		ctx = context.Background()
    16  	})
    17  
    18  	It("should set and get team and pipeline", func() {
    19  		newCtx := policy.RecordTeamAndPipeline(ctx, "some-team", "some-pipeline")
    20  		Expect(newCtx).ToNot(BeNil())
    21  
    22  		team, pipeline := policy.TeamAndPipelineFromContext(newCtx)
    23  		Expect(team).To(Equal("some-team"))
    24  		Expect(pipeline).To(Equal("some-pipeline"))
    25  	})
    26  })