Fixing plugin test

In the TestLoadDir test case, currently reflect.DeepEqual is expected to fail by error. Expected metadata is different than in the fixture yaml. Also, the type of the struct is mismatching in DeepEqual call (struct vs pointer to struct).
pull/2106/head
libesz 8 years ago
parent 6da348baef
commit 41f7c97a48

@ -74,7 +74,7 @@ func TestLoadDir(t *testing.T) {
t.Errorf("Expected dir %q, got %q", dirname, plug.Dir) t.Errorf("Expected dir %q, got %q", dirname, plug.Dir)
} }
expect := Metadata{ expect := &Metadata{
Name: "hello", Name: "hello",
Version: "0.1.0", Version: "0.1.0",
Usage: "usage", Usage: "usage",
@ -84,8 +84,8 @@ func TestLoadDir(t *testing.T) {
IgnoreFlags: true, IgnoreFlags: true,
} }
if reflect.DeepEqual(expect, plug.Metadata) { if !reflect.DeepEqual(expect, plug.Metadata) {
t.Errorf("Expected name %v, got %v", expect, plug.Metadata) t.Errorf("Expected plugin metadata %v, got %v", expect, plug.Metadata)
} }
} }

@ -3,6 +3,6 @@ version: "0.1.0"
usage: "usage" usage: "usage"
description: |- description: |-
description description
command: "$HELM_PLUGIN_SELF/helm-hello" command: "$HELM_PLUGIN_SELF/hello.sh"
useTunnel: true useTunnel: true
ignoreFlags: true ignoreFlags: true

Loading…
Cancel
Save