Skip to content

Commit

Permalink
Use require for empty assertion
Browse files Browse the repository at this point in the history
Signed-off-by: Devanshu <devanshu.d@broadcom.com>
  • Loading branch information
devanshuVmware authored and 100mik committed Nov 22, 2024
1 parent ae8785b commit e8e5ce8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cli/pkg/kctrl/cmd/app/release/release_cmd_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

0 comments on commit e8e5ce8

Please sign in to comment.