Esempio n. 1
0
import (
	"errors"
	"github.com/crowley-io/pack/configuration"
	"github.com/crowley-io/pack/docker"

	. "github.com/crowley-io/pack/install"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Install", func() {

	var (
		c   *configuration.Configuration
		ls  = docker.NewLogStream()
		d   *docker.Mock
		err error
	)

	Describe("create an artefact from a docker container", func() {
		JustBeforeEach(func() {
			err = Install(d, ls, c)
		})
		Context("when the configuration is valid", func() {
			BeforeEach(func() {

				c = getDefaultConfiguration()
				d = docker.NewMock()

			})
			It("should succeed", func() {
Esempio n. 2
0
import (
	"errors"
	"github.com/crowley-io/pack/configuration"
	"github.com/crowley-io/pack/docker"

	. "github.com/crowley-io/pack/publish"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Publish", func() {

	var (
		c   *configuration.Configuration
		ls  = docker.NewLogStream()
		d   *docker.Mock
		err error
	)

	Describe("push an image into a registy", func() {
		Context("when the configuration is valid", func() {
			BeforeEach(func() {

				c = getDefaultConfiguration()
				d = docker.NewMock()

			})
			JustBeforeEach(func() {
				err = Publish(d, ls, c)
			})
			It("should succeed", func() {
Esempio n. 3
0
import (
	"errors"
	"github.com/crowley-io/pack/configuration"
	"github.com/crowley-io/pack/docker"

	. "github.com/crowley-io/pack/compose"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Compose", func() {

	var (
		c   *configuration.Configuration
		ls  = docker.NewLogStream()
		d   *docker.Mock
		err error
	)

	AssertNoDockerClientUsage := func() {
		It("should return an error", func() {
			Expect(err).To(HaveOccurred())
		})
		It("should not use the docker client", func() {
			Expect(d.ImageIDCalled).To(BeFalse())
			Expect(d.BuildCalled).To(BeFalse())
			Expect(d.RemoveImageCalled).To(BeFalse())
		})
	}

	ExpectDockerBuildImage := func() {