aports/testing/asdf/fix-test.patch
Mate Farkas 22aea81b98 testing/asdf: new aport
https://asdf-vm.com/
The Multiple Runtime Version Manager
2025-02-09 21:34:16 +00:00

25 lines
695 B
Diff

Pass SHELL environment variable to subshell
diff --git a/cmd/asdf/main_test.go b/cmd/asdf/main_test.go
index 89bd4ab..7f621b0 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"
@@ -122,7 +123,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 {