]> Sergey Matveev's repositories - zsh-autoenv.git/blobdiff - tests/setup.sh
Some more refactoring, adding support for `autoenv_source_parent`
[zsh-autoenv.git] / tests / setup.sh
index 9134af05133888eee3aa030d92c1c5a061634f1e..d5a4f6e385c9222e2149a5a203050a4a9b7cac2e 100644 (file)
@@ -3,16 +3,19 @@
 
 [[ $AUTOENV_ENV_FILENAME[0,4] == '/tmp' ]] || return 1
 
+# Reset any authentication.
+echo -n > $AUTOENV_ENV_FILENAME
+
 # Inject timeout for `read` while running tests.
 _AUTOENV_TEST_READ_ARGS='-t 1'
 
+# Add file $1 (with optional hash $2) to authentication file.
 test_autoenv_add_to_env() {
   _autoenv_hash_pair $1 $2 >> $AUTOENV_ENV_FILENAME
 }
 
 # Add enter and leave env files to authentication file.
 test_autoenv_auth_env_files() {
-  echo -n > $AUTOENV_ENV_FILENAME
   test_autoenv_add_to_env $PWD/$AUTOENV_FILE_ENTER
   test_autoenv_add_to_env $PWD/$AUTOENV_FILE_LEAVE
 }