Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package config_test
import (
"os"
"path/filepath"
"strings"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -39,15 +40,9 @@ var _ = Describe("Config", func() {
BeforeEach(func() {
// Clear all VIRTWORK_ env vars before each test
for _, env := range os.Environ() {
if len(env) > 9 && env[:9] == "VIRTWORK_" {
key := env[:len(env)-len(env[len(env)-len(env):])]
for i := 0; i < len(env); i++ {
if env[i] == '=' {
key = env[:i]
break
}
}
os.Unsetenv(key)
if strings.HasPrefix(env, "VIRTWORK_") {
virtworkEnv := strings.Split(env, "=")[0]
_ = os.Unsetenv(virtworkEnv)
}
}
cmd = newTestCommand()
Expand Down