Skip to content

Commit

Permalink
fix(util-env): use testify-assert to check (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
whg517 committed Jul 11, 2024
1 parent 689b75b commit 67120fb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/util/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package util
import (
"testing"

"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
)

Expand All @@ -23,9 +24,5 @@ func TestNewEnvVarsFromMap(t *testing.T) {
t.Errorf("Expected %d env vars, but got %d", len(expectedEnvVars), len(envVars))
}

for i, expectedEnvVar := range expectedEnvVars {
if envVars[i].Name != expectedEnvVar.Name || envVars[i].Value != expectedEnvVar.Value {
t.Errorf("Expected env var %s=%s, but got %s=%s", expectedEnvVar.Name, expectedEnvVar.Value, envVars[i].Name, envVars[i].Value)
}
}
assert.Equal(t, expectedEnvVars, envVars)
}

0 comments on commit 67120fb

Please sign in to comment.