2018-03-06 09:12:29 -05:00
|
|
|
package main
|
|
|
|
|
2018-03-06 10:14:23 -05:00
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
)
|
2018-03-06 09:12:29 -05:00
|
|
|
|
|
|
|
func TestList(t *testing.T) {
|
2018-06-17 15:41:58 -04:00
|
|
|
out, err := run("ls", domain)
|
2018-03-06 09:12:29 -05:00
|
|
|
if err != nil {
|
2018-06-17 15:41:58 -04:00
|
|
|
t.Fatalf("output: %s, error: %v", out, err)
|
2018-03-06 09:12:29 -05:00
|
|
|
}
|
2018-06-17 15:41:58 -04:00
|
|
|
|
|
|
|
expected := `REPO TAGS
|
|
|
|
alpine 3.5, latest
|
|
|
|
busybox glibc, latest, musl`
|
|
|
|
if !strings.HasSuffix(strings.TrimSpace(out), expected) {
|
|
|
|
t.Fatalf("expected to contain: %s\ngot: %s", expected, out)
|
2018-03-06 09:12:29 -05:00
|
|
|
}
|
|
|
|
}
|