diff --git a/tests/ZDOTDIR.clobber/.zshenv b/tests/ZDOTDIR.clobber/.zshenv index 62037dc..84c8c22 100644 --- a/tests/ZDOTDIR.clobber/.zshenv +++ b/tests/ZDOTDIR.clobber/.zshenv @@ -1,3 +1,4 @@ +# Source base setup. source ${ZDOTDIR}/../ZDOTDIR/.zshenv setopt noclobber diff --git a/tests/ZDOTDIR.invalid-module_path/.zshenv b/tests/ZDOTDIR.invalid-module_path/.zshenv index baa1de6..90f1bd1 100644 --- a/tests/ZDOTDIR.invalid-module_path/.zshenv +++ b/tests/ZDOTDIR.invalid-module_path/.zshenv @@ -10,4 +10,5 @@ zstat() { echo "Should not get called." } +# Source base setup. source ${ZDOTDIR}/../ZDOTDIR/.zshenv diff --git a/tests/ZDOTDIR.loadviafunction/.zshenv b/tests/ZDOTDIR.loadviafunction/.zshenv index 8f836b5..9ff2371 100644 --- a/tests/ZDOTDIR.loadviafunction/.zshenv +++ b/tests/ZDOTDIR.loadviafunction/.zshenv @@ -1,11 +1,7 @@ -test -f "$TESTDIR/.zcompdump" && rm "$TESTDIR/.zcompdump" - -AUTOENV_DEBUG=0 +# Source base setup. +source ${ZDOTDIR}/../ZDOTDIR/.zshenv antigen-like-loader-function() { source "$TESTDIR/../autoenv.plugin.zsh" } - -export AUTOENV_ENV_FILENAME="$PWD/.env_auth" - -echo -n > $AUTOENV_ENV_FILENAME +TEST_SOURCE_AUTOENV=antigen-like-loader-function diff --git a/tests/ZDOTDIR/.zshenv b/tests/ZDOTDIR/.zshenv index 07e8b5b..d99243d 100644 --- a/tests/ZDOTDIR/.zshenv +++ b/tests/ZDOTDIR/.zshenv @@ -1,7 +1,3 @@ -test -f "$TESTDIR/.zcompdump" && rm "$TESTDIR/.zcompdump" +# Base setup/config. -AUTOENV_DEBUG=0 - -export AUTOENV_ENV_FILENAME="$PWD/.env_auth" - -echo -n > $AUTOENV_ENV_FILENAME +TEST_SOURCE_AUTOENV=(source $TESTDIR/../autoenv.plugin.zsh) diff --git a/tests/setup.zsh b/tests/setup.zsh index 27ba423..d8a018e 100644 --- a/tests/setup.zsh +++ b/tests/setup.zsh @@ -9,6 +9,8 @@ # Not handled in varstash yet. # setopt nounset +export AUTOENV_ENV_FILENAME="$CRAMTMP/.env_auth" + if [[ $AUTOENV_ENV_FILENAME[0,4] != '/tmp' ]]; then echo "AUTOENV_ENV_FILENAME is not in /tmp. Aborting." return 1 @@ -18,11 +20,7 @@ fi _save_errexit=${options[errexit]} set -e -if (( ${+functions[antigen-like-loader-function]} )); then - TEST_SOURCE_AUTOENV=antigen-like-loader-function -else - TEST_SOURCE_AUTOENV=(source $TESTDIR/../autoenv.plugin.zsh) -fi +# Defined in .zshenv, e.g. tests/ZDOTDIR/.zshenv. $TEST_SOURCE_AUTOENV # Reset any authentication.