From 3120fa3d2b55dab4eee15e941c6f5d139346f86d Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Wed, 27 Nov 2024 09:44:32 -0500 Subject: [PATCH] feat(golang-rewrite): correct shim_env_command.bats test --- test/shim_env_command.bats | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/shim_env_command.bats b/test/shim_env_command.bats index 6bf5cc2..f7fe11d 100644 --- a/test/shim_env_command.bats +++ b/test/shim_env_command.bats @@ -67,9 +67,15 @@ teardown() { echo "dummy 1.0" >"$PROJECT_DIR/.tool-versions" run asdf install - echo "export FOO=bar" >"$ASDF_DIR/plugins/dummy/bin/exec-env" + echo '#!/usr/bin/env bash + export FOO=bar' >"$ASDF_DIR/plugins/dummy/bin/exec-env" chmod +x "$ASDF_DIR/plugins/dummy/bin/exec-env" + # Create a "system" dummy executable + echo '#!/usr/bin/env bash + echo "system dummy"' > $ASDF_BIN/dummy + chmod +x $ASDF_BIN/dummy + echo "dummy system" >"$PROJECT_DIR/.tool-versions" run asdf env dummy @@ -80,8 +86,10 @@ teardown() { [ "$status" -eq 1 ] run asdf env dummy which dummy - [ "$output" = "$ASDF_DIR/shims/dummy" ] + [ "$output" = "$ASDF_BIN/dummy" ] [ "$status" -eq 0 ] + # Remove "system" dummy executable + rm $ASDF_BIN/dummy } @test "asdf env should set PATH correctly" {