From 146c61af3765417c4b0d95bbb1a4ad73d3c228c9 Mon Sep 17 00:00:00 2001 From: Henry Nash Date: Wed, 5 Dec 2018 21:08:51 +0000 Subject: [PATCH] fix(helm): Correct and improve resilence of template check in unit test (#5010) Make the current check for the number of templates on create more resilient by using a varible to store the expected number of templates. In addition, fix the error message so that it displays the correct number expected of templates. Closes #5009 Signed-off-by: Henry Nash --- cmd/helm/create_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/helm/create_test.go b/cmd/helm/create_test.go index 3cdf5ebf8..c9459b477 100644 --- a/cmd/helm/create_test.go +++ b/cmd/helm/create_test.go @@ -143,8 +143,9 @@ func TestCreateStarterCmd(t *testing.T) { t.Errorf("Wrong API version: %q", c.Metadata.ApiVersion) } - if l := len(c.Templates); l != 7 { - t.Errorf("Expected 6 templates, got %d", l) + expectedTemplateCount := 7 + if l := len(c.Templates); l != expectedTemplateCount { + t.Errorf("Expected %d templates, got %d", expectedTemplateCount, l) } found := false