예제 #1
0
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/concourse/atc/worker"
	"github.com/concourse/atc/worker/fakes"
	"github.com/concourse/baggageclaim"
	bfakes "github.com/concourse/baggageclaim/fakes"
	"github.com/pivotal-golang/clock/fakeclock"
	"github.com/pivotal-golang/lager/lagertest"
)

var _ = Describe("Volumes", func() {
	var (
		volumeFactory worker.VolumeFactory
		fakeVolume    *bfakes.FakeVolume
		fakeDB        *fakes.FakeVolumeFactoryDB
		fakeClock     *fakeclock.FakeClock
		logger        *lagertest.TestLogger
	)

	BeforeEach(func() {
		fakeVolume = new(bfakes.FakeVolume)
		fakeDB = new(fakes.FakeVolumeFactoryDB)
		fakeClock = fakeclock.NewFakeClock(time.Unix(123, 456))
		logger = lagertest.NewTestLogger("test")

		volumeFactory = worker.NewVolumeFactory(fakeDB, fakeClock)
	})

	Context("VolumeFactory", func() {
		Describe("Build", func() {
예제 #2
0
파일: volume_test.go 프로젝트: ACPK/atc
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/concourse/atc/worker/fakes"
	bfakes "github.com/concourse/baggageclaim/fakes"
	"github.com/pivotal-golang/clock/fakeclock"
	"github.com/pivotal-golang/lager/lagertest"

	"github.com/concourse/atc/worker"
)

var _ = Describe("Volumes", func() {
	var (
		volumeFactory worker.VolumeFactory
		fakeVolume    *bfakes.FakeVolume
		fakeDB        *fakes.FakeVolumeFactoryDB
		fakeClock     *fakeclock.FakeClock
	)

	BeforeEach(func() {
		fakeVolume = new(bfakes.FakeVolume)
		fakeDB = new(fakes.FakeVolumeFactoryDB)
		fakeClock = fakeclock.NewFakeClock(time.Unix(123, 456))

		volumeFactory = worker.NewVolumeFactory(lagertest.NewTestLogger("test"), fakeDB, fakeClock)
	})

	Context("VolumeFactory", func() {
		Describe("Build", func() {
			It("releases the volume it was given", func() {
				_, err := volumeFactory.Build(fakeVolume)