Commit 71fa7ecb authored by Adam Reese's avatar Adam Reese

ref(cmd): remove duplicate test cases

parent 578ba71b
...@@ -24,53 +24,6 @@ import ( ...@@ -24,53 +24,6 @@ import (
"k8s.io/helm/pkg/proto/hapi/release" "k8s.io/helm/pkg/proto/hapi/release"
) )
func TestListRun(t *testing.T) {
tests := []struct {
name string
listCmd *listCmd
expected string
err bool
}{
{
name: "with a release",
listCmd: &listCmd{
client: &fakeReleaseClient{
rels: []*release.Release{
releaseMock("thomas-guide"),
},
},
},
expected: "thomas-guide",
},
{
name: "list --long",
listCmd: &listCmd{
client: &fakeReleaseClient{
rels: []*release.Release{
releaseMock("atlas"),
},
},
long: true,
},
expected: "NAME \tVERSION\tUPDATED \tSTATUS \tCHART \natlas\t1 \t(.*)\tDEPLOYED\tfoo-0.1.0-beta.1\n",
},
}
var buf bytes.Buffer
for _, tt := range tests {
tt.listCmd.out = &buf
err := tt.listCmd.run()
if (err != nil) != tt.err {
t.Errorf("%q. expected error: %v, got %v", tt.name, tt.err, err)
}
re := regexp.MustCompile(tt.expected)
if !re.Match(buf.Bytes()) {
t.Errorf("%q. expected %q, got %q", tt.name, tt.expected, buf.String())
}
buf.Reset()
}
}
func TestListCmd(t *testing.T) { func TestListCmd(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment