]> Sergey Matveev's repositories - zsh-autoenv.git/blobdiff - tests/varstash.t
Some more refactoring, adding support for `autoenv_source_parent`
[zsh-autoenv.git] / tests / varstash.t
index bc49657850347620803c106a05e6db09178f5d6c..74580441c27efbe01bfa8b7ded0fa262d5c4141e 100644 (file)
@@ -4,20 +4,14 @@ Test varstash integration.
 
 Setup test environment.
 
-# Defaults:
-# $ DOTENV_FILE_ENTER=.env
-# $ DOTENV_FILE_LEAVE=.env.leave
-# $ DOTENV_HANDLE_LEAVE=1
-
   $ mkdir sub
   $ cd sub
-  $ echo "autostash FOO=baz" > $DOTENV_FILE_ENTER
-  $ echo "autounstash" > $DOTENV_FILE_LEAVE
+  $ echo 'echo ENTER; autostash FOO=baz' > $AUTOENV_FILE_ENTER
+  $ echo 'echo LEAVE; autounstash' > $AUTOENV_FILE_LEAVE
 
 Manually create auth file
 
-  $ echo "$PWD/$DOTENV_FILE_ENTER:$(echo $(<$DOTENV_FILE_ENTER) | shasum)" > $AUTOENV_ENV_FILENAME
-  $ echo "$PWD/$DOTENV_FILE_LEAVE:$(echo $(<$DOTENV_FILE_LEAVE) | shasum)" >> $AUTOENV_ENV_FILENAME
+  $ test_autoenv_auth_env_files
 
 Set environment variable.
 
@@ -26,11 +20,13 @@ Set environment variable.
 Activating the env stashes it and applies a new value.
 
   $ cd .
+  ENTER
   $ echo $FOO
   baz
 
 Leaving the directory unstashes it.
 
   $ cd ..
+  LEAVE
   $ echo $FOO
   bar