github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/atc/db/pipeline_ref_test.go (about)

     1  package db_test
     2  
     3  import (
     4  	"github.com/pf-qiu/concourse/v6/atc/db"
     5  
     6  	. "github.com/onsi/ginkgo"
     7  	. "github.com/onsi/gomega"
     8  )
     9  
    10  var _ = Describe("PipelineRef", func() {
    11  	var (
    12  		pr db.PipelineRef
    13  	)
    14  
    15  	BeforeEach(func() {
    16  		pr = db.NewPipelineRef(defaultPipeline.ID(), defaultPipeline.Name(), defaultPipeline.InstanceVars(), dbConn, lockFactory)
    17  	})
    18  
    19  	It("id should be correct", func() {
    20  		Expect(pr.PipelineID()).To(Equal(defaultPipeline.ID()))
    21  	})
    22  
    23  	It("name should be correct", func() {
    24  		Expect(pr.PipelineName()).To(Equal(defaultPipeline.Name()))
    25  	})
    26  
    27  	It("instance vars should be correct", func() {
    28  		Expect(pr.PipelineInstanceVars()).To(Equal(defaultPipeline.InstanceVars()))
    29  	})
    30  
    31  	It("pipeline should be correct", func() {
    32  		p, found, err := pr.Pipeline()
    33  		Expect(err).ToNot(HaveOccurred())
    34  		Expect(found).To(BeTrue())
    35  		Expect(p).To(Equal(defaultPipeline))
    36  	})
    37  })