--- a/docker/errors.go Fri Oct 13 12:06:41 2017 -0500
+++ b/docker/errors.go Fri Oct 13 12:07:40 2017 -0500
@@ -32,5 +32,5 @@
errNoImages = errors.New("no images specified")
errNoSourceTag = errors.New("no source tag specified")
errNoDestinationTags = errors.New("no destination tags specified")
- errNoFilesInject = errors.New("no environment files specified")
+ errNoFilesEnvironment = errors.New("no environment files specified") --- a/docker/export_test.go Fri Oct 13 12:06:41 2017 -0500
+++ b/docker/export_test.go Fri Oct 13 12:07:40 2017 -0500
@@ -18,19 +18,50 @@
+ . "github.com/onsi/gomega" + "github.com/aphistic/sweet" + "github.com/go-yaml/yaml" + cYaml "bitbucket.org/rw_grim/convey/yaml"
- errNoDockerFile = errors.New("no dockerfile specified")
- errNoTag = errors.New("no tag specified")
- errWildcardWithDestination = errors.New("file list contains a wildcard with a destination")
- errNoFiles = errors.New("no files specified")
- errNoServer = errors.New("no server specified")
- errNoUsername = errors.New("no username specified")
- errNoImage = errors.New("no image specified")
- errNoImages = errors.New("no images specified")
- errNoSourceTag = errors.New("no source tag specified")
- errNoDestinationTags = errors.New("no destination tags specified")
- errNoFilesEnvironment = errors.New("no environment files specified")
+func (s *dockerSuite) TestExport(t sweet.T) { + e := &Export{Files: cYaml.StringOrSlice{"foo"}} + Expect(e.Valid()).To(BeNil()) +func (s *dockerSuite) TestExportFilesRequired(t sweet.T) { + Expect(e.Valid()).To(MatchError(errNoFiles)) +func (s *dockerSuite) TestExportFilesDoesNotAllowWildcardWithDestination(t sweet.T) { + Files: cYaml.StringOrSlice{"*:/foo"}, + Expect(e.Valid()).To(MatchError(errWildcardWithDestination)) +func (s *dockerSuite) TestExportUnmarshalString(t sweet.T) { + data := `files: filename` + err := yaml.Unmarshal([]byte(data), &exp) + Expect(err).To(BeNil()) + Expect(exp.Files).To(Equal(cYaml.StringOrSlice{"filename"})) +func (s *dockerSuite) TestExportUnmarshalStringSlice(t sweet.T) { + err := yaml.Unmarshal([]byte(data), &exp) + Expect(err).To(BeNil()) + Expect(exp.Files).To(Equal(cYaml.StringOrSlice{"filename1", "filename2"}))