mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-12-24 20:35:03 -07:00
feat(golang-rewrite): set variables for bats integration tests
This commit is contained in:
parent
ff82d9787c
commit
4d5108c905
@ -131,9 +131,10 @@ func run_bats_file(t *testing.T, dir, filename string) {
|
||||
cmd.Stdout = &stdout
|
||||
cmd.Stderr = &stderr
|
||||
|
||||
// Add dir to front of path
|
||||
path := os.Getenv("PATH")
|
||||
cmd.Env = append(cmd.Environ(), fmt.Sprintf("PATH=%s:%s", dir, path))
|
||||
// Add dir to asdf test variables
|
||||
asdf_test_home := fmt.Sprintf("HOME=%s/.asdf/", dir)
|
||||
asdf_bin_path := fmt.Sprintf("ASDF_BIN=%s", dir)
|
||||
cmd.Env = append(cmd.Environ(), asdf_bin_path, asdf_test_home)
|
||||
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
|
@ -12,13 +12,15 @@ setup_asdf_dir() {
|
||||
BASE_DIR="$(mktemp -dt "asdf with spaces.XXXX")"
|
||||
fi
|
||||
|
||||
HOME="$BASE_DIR/home"
|
||||
# HOME is now defined by the Golang test code in main_test.go
|
||||
#HOME="$BASE_DIR/home"
|
||||
ASDF_DIR="$HOME/.asdf"
|
||||
mkdir -p "$ASDF_DIR/plugins"
|
||||
mkdir -p "$ASDF_DIR/installs"
|
||||
mkdir -p "$ASDF_DIR/shims"
|
||||
mkdir -p "$ASDF_DIR/tmp"
|
||||
ASDF_BIN="$(dirname "$BATS_TEST_DIRNAME")/bin"
|
||||
# ASDF_BIN is now defined by the Golang test code in main_test.go
|
||||
#ASDF_BIN="$(dirname "$BATS_TEST_DIRNAME")/bin"
|
||||
|
||||
# shellcheck disable=SC2031
|
||||
PATH="$ASDF_BIN:$ASDF_DIR/shims:$PATH"
|
||||
|
Loading…
Reference in New Issue
Block a user