From 03b04639f38f11b9f909ac0ddd86a82f7c43bb4c Mon Sep 17 00:00:00 2001 From: Zhou Hao Date: Mon, 17 Feb 2020 13:48:12 +0800 Subject: [PATCH] pkg/gates: add unit test for String Signed-off-by: Zhou Hao --- pkg/gates/gates_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/gates/gates_test.go b/pkg/gates/gates_test.go index a71d4905b..6bdd17ed6 100644 --- a/pkg/gates/gates_test.go +++ b/pkg/gates/gates_test.go @@ -45,3 +45,12 @@ func TestError(t *testing.T) { t.Errorf("incorrect error message. Received %s", g.Error().Error()) } } + +func TestString(t *testing.T) { + os.Unsetenv(name) + g := Gate(name) + + if g.String() != "HELM_EXPERIMENTAL_FEATURE" { + t.Errorf("incorrect string representation. Received %s", g.String()) + } +}