grim/convey

Start updating the documentation
redux
2021-10-16, Gary Kramlich
738aea24df10
Start updating the documentation
package docker
import (
"testing"
. "github.com/onsi/gomega"
"keep.imfreedom.org/grim/convey/podman"
"keep.imfreedom.org/grim/convey/yaml"
)
func TestPushImage(t *testing.T) {
g := NewGomegaWithT(t)
p := &Push{
Image: "foo",
}
g.Expect(p.Valid()).To(BeNil())
}
func TestPushImages(t *testing.T) {
g := NewGomegaWithT(t)
p := &Push{
Images: []string{"foo", "bar"},
}
g.Expect(p.Valid()).To(BeNil())
}
func TestPushImagesMerged(t *testing.T) {
g := NewGomegaWithT(t)
p := &Push{
Image: "foo",
Images: []string{"bar"},
}
g.Expect(p.Valid()).To(BeNil())
g.Expect(p.Images).To(Equal(yaml.StringOrSlice{"foo", "bar"}))
}
func TestPushImageRequired(t *testing.T) {
g := NewGomegaWithT(t)
p := &Push{}
g.Expect(p.Valid()).To(MatchError(podman.ErrNoTags))
}