grim/convey

Add the convey version to the environment
redux
2021-10-11, Gary Kramlich
82d28cf8e74d
Add the convey version to the environment
package docker
import (
"testing"
. "github.com/onsi/gomega"
"keep.imfreedom.org/grim/convey/podman"
"keep.imfreedom.org/grim/convey/yaml"
)
func TestPullImage(t *testing.T) {
g := NewGomegaWithT(t)
p := &Pull{
Image: "foo",
}
g.Expect(p.Valid()).To(BeNil())
}
func TestPullImages(t *testing.T) {
g := NewGomegaWithT(t)
p := &Pull{
Images: []string{"foo", "bar"},
}
g.Expect(p.Valid()).To(BeNil())
}
func TestPullImagesMerged(t *testing.T) {
g := NewGomegaWithT(t)
p := &Pull{
Image: "foo",
Images: []string{"bar"},
}
g.Expect(p.Valid()).To(BeNil())
g.Expect(p.Images).To(Equal(yaml.StringOrSlice{"foo", "bar"}))
}
func TestPullImageRequired(t *testing.T) {
g := NewGomegaWithT(t)
p := &Push{}
g.Expect(p.Valid()).To(MatchError(podman.ErrNoTags))
}