github.com/chenbh/concourse/v6@v6.4.2/atc/gc/pipeline_collector_test.go (about)

     1  package gc_test
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/chenbh/concourse/v6/atc/db/dbfakes"
     7  	"github.com/chenbh/concourse/v6/atc/gc"
     8  	. "github.com/onsi/ginkgo"
     9  	. "github.com/onsi/gomega"
    10  )
    11  
    12  var _ = Describe("PipelineCollector", func() {
    13  	var collector GcCollector
    14  	var fakePipelineLifecycle *dbfakes.FakePipelineLifecycle
    15  
    16  	BeforeEach(func() {
    17  		fakePipelineLifecycle = new(dbfakes.FakePipelineLifecycle)
    18  
    19  		collector = gc.NewPipelineCollector(fakePipelineLifecycle)
    20  	})
    21  
    22  	Describe("Run", func() {
    23  		It("tells the pipeline lifecycle to remove abandoned pipelines", func() {
    24  			err := collector.Run(context.TODO())
    25  			Expect(err).NotTo(HaveOccurred())
    26  
    27  			Expect(fakePipelineLifecycle.ArchiveAbandonedPipelinesCallCount()).To(Equal(1))
    28  		})
    29  	})
    30  })