From e8e5ce8737788f67b1260bb9dca7e77eb862409f Mon Sep 17 00:00:00 2001 From: Devanshu Date: Thu, 21 Nov 2024 21:17:08 +0530 Subject: [PATCH] Use require for empty assertion Signed-off-by: Devanshu --- cli/pkg/kctrl/cmd/app/release/release_cmd_runner_test.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cli/pkg/kctrl/cmd/app/release/release_cmd_runner_test.go b/cli/pkg/kctrl/cmd/app/release/release_cmd_runner_test.go index c4004950d..c29f62cdb 100644 --- a/cli/pkg/kctrl/cmd/app/release/release_cmd_runner_test.go +++ b/cli/pkg/kctrl/cmd/app/release/release_cmd_runner_test.go @@ -11,11 +11,8 @@ import ( func TestReleaseCmdRunnerForKappCmd(t *testing.T) { var buf bytes.Buffer ReleaseCmdRunner := NewReleaseCmdRunner(&buf, false, "", false, nil) - cmd := exec.Command("kapp", "deploy", "-f", "-", "-a", "pkg-test", "-y") + cmd := exec.Command("kapp", "deploy", "-f", "https://github.com/carvel-dev/kapp-controller/releases/latest/download/release.yml", "-a", "pkg-test", "-y") err := ReleaseCmdRunner.RunWithCancel(cmd, nil) require.NoError(t, err) - expectedLength := 0 - if actualLength := buf.Len(); actualLength != expectedLength { - t.Errorf("Got Buffer length = %d, Expected empty", actualLength) - } + require.Emptyf(t, buf.Len(), "Expected buf length 0 but got %d", buf.Len()) }