]> Sergey Matveev's repositories - zsh-autoenv.git/blobdiff - tests/autoenv.t
tests: define/use $TEST_SOURCE_AUTOENV
[zsh-autoenv.git] / tests / autoenv.t
index 701e3b463967d21abb56e773929655f6d8ad343d..67be7ca7f27891ca676f32ca90f42fe06166f4cb 100644 (file)
@@ -1,8 +1,8 @@
-  $ source $TESTDIR/setup.sh
+  $ source $TESTDIR/setup.sh || return 1
 
 Lets set a simple .env action
 
-  $ echo 'echo ENTERED' >> .env
+  $ echo 'echo ENTERED' > .env
 
 Manually create auth file
 
@@ -74,6 +74,7 @@ Now, will it take no for an answer?
 
 Lets also try one more time to ensure it didn't add it.
 
+  $ _autoenv_ask_for_yes() { echo "yes"; return 0 }
   $ cd .
   Attempting to load unauthorized env file!
   -* /tmp/cramtests-*/autoenv.t/.env (glob)
@@ -84,4 +85,11 @@ Lets also try one more time to ensure it didn't add it.
   
   **********************************************
   
-  Would you like to authorize it? (type 'yes') no
+  Would you like to authorize it? (type 'yes') yes
+  ENTERED
+
+Reloading the script should keep the current state, e.g. when reloading your
+~/.zshrc.
+
+  $ $TEST_SOURCE_AUTOENV
+  $ cd .