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 TestRemoveImage(t *testing.T) {
g := NewGomegaWithT(t)
r := &Remove{
Image: "foo",
}
g.Expect(r.Valid()).To(BeNil())
}
func TestRemoveImages(t *testing.T) {
g := NewGomegaWithT(t)
r := &Remove{
Images: []string{"foo", "bar"},
}
g.Expect(r.Valid()).To(BeNil())
}
func TestRemoveMerge(t *testing.T) {
g := NewGomegaWithT(t)
r := &Remove{
Image: "foo",
Images: []string{"bar", "baz"},
}
g.Expect(r.Valid()).To(BeNil())
g.Expect(r.Images).To(Equal(yaml.StringOrSlice{"foo", "bar", "baz"}))
}
func TestRemoveImagesRequired(t *testing.T) {
g := NewGomegaWithT(t)
r := &Remove{}
g.Expect(r.Valid()).To(MatchError(podman.ErrNoTags))
}