aports/testing/asdf/fix-test.patch

25 lines
695 B
Diff
Raw Normal View History

Pass SHELL environment variable to subshell
diff --git a/cmd/asdf/main_test.go b/cmd/asdf/main_test.go
2025-03-06 19:45:48 +00:00
index 38c39c7..83d5c86 100644
--- a/cmd/asdf/main_test.go
+++ b/cmd/asdf/main_test.go
@@ -2,6 +2,7 @@ package main
import (
"fmt"
+ "os"
"os/exec"
"strings"
"testing"
2025-03-06 19:45:48 +00:00
@@ -126,7 +127,8 @@ func runBatsFile(t *testing.T, dir, filename string) {
// Add dir to asdf test variables
asdfTestHome := fmt.Sprintf("BASE_DIR=%s", dir)
asdfBinPath := fmt.Sprintf("ASDF_BIN=%s", dir)
- cmd.Env = []string{asdfBinPath, asdfTestHome}
+ shellEnv := fmt.Sprintf("SHELL=%s", os.Getenv("SHELL"))
+ cmd.Env = []string{asdfBinPath, asdfTestHome, shellEnv}
err := cmd.Run()
if err != nil {