]> Sergey Matveev's repositories - zsh-autoenv.git/commitdiff
Fix tests: match $CRAMTMP more losely (#78)
authorDaniel Hahler <github@thequod.de>
Wed, 13 Dec 2017 23:53:53 +0000 (00:53 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Dec 2017 23:53:53 +0000 (00:53 +0100)
Fixes https://github.com/Tarrasch/zsh-autoenv/issues/76.

tests/_autoenv_utils.t
tests/autoenv.t
tests/leave.t
tests/recurse-upwards.t
tests/setup.zsh
tests/upgrade_hash.t

index c77779f969a6cf108b20ac4988323b424a181199..cd8b9ad5f9cda835540c197b4385133cdb8e0ab0 100644 (file)
@@ -46,41 +46,41 @@ Now adding some auth pair.
   $ echo first > first
   $ _autoenv_authorize first
   $ cat $AUTOENV_AUTH_FILE
-  :/tmp/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
 
 And a second one.
 
   $ echo second > second
   $ _autoenv_authorize second
   $ cat $AUTOENV_AUTH_FILE
-  :/tmp/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
-  :/tmp/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
 
 And a third.
 
   $ echo third > third
   $ _autoenv_authorize third
   $ cat $AUTOENV_AUTH_FILE
-  :/tmp/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
-  :/tmp/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
-  :/tmp/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
 
 Re-add the second one, with the same hash.
 
   $ _autoenv_authorize second
   $ cat $AUTOENV_AUTH_FILE
-  :/tmp/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
-  :/tmp/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
-  :/tmp/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
 
 Re-add the first one, with a new hash.
 
   $ echo one more line >> first
   $ _autoenv_authorize first
   $ cat $AUTOENV_AUTH_FILE
-  :/tmp/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
-  :/tmp/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
-  :/tmp/cramtests-*/_autoenv_utils.t/first:3620404822.20:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
+  :/*/cramtests-*/_autoenv_utils.t/first:3620404822.20:2 (glob)
 }}}
 
 
index aeeeea4963d22ea3c62e4e17d54fc0f55fb035bc..8d2e864c5bff970bb7bb180b9f09919a5a7ad957 100644 (file)
@@ -17,7 +17,7 @@ Now try to make it accept it
   $ _autoenv_ask_for_yes() { echo "yes" }
   $ cd .
   Attempting to load unauthorized env file!
-  -* /tmp/cramtests-*/autoenv.t/.autoenv.zsh (glob)
+  -* /*/cramtests-*/autoenv.t/.autoenv.zsh (glob)
   
   **********************************************
   
@@ -42,7 +42,7 @@ Now lets see that it actually checks the shasum value.
   $ test_autoenv_add_to_env $PWD/.autoenv.zsh mischief
   $ cd .
   Attempting to load unauthorized env file!
-  -* /tmp/cramtests-*/autoenv.t/.autoenv.zsh (glob)
+  -* /*/cramtests-*/autoenv.t/.autoenv.zsh (glob)
   
   **********************************************
   
@@ -61,7 +61,7 @@ Now, will it take no for an answer?
   $ _autoenv_ask_for_yes() { echo "no"; return 1 }
   $ cd .
   Attempting to load unauthorized env file!
-  -* /tmp/cramtests-*/autoenv.t/.autoenv.zsh (glob)
+  -* /*/cramtests-*/autoenv.t/.autoenv.zsh (glob)
   
   **********************************************
   
@@ -77,7 +77,7 @@ 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/.autoenv.zsh (glob)
+  -* /*/cramtests-*/autoenv.t/.autoenv.zsh (glob)
   
   **********************************************
   
index 46580b76469b5f58563d212f446c771af95514cf..9cad5d03b329022c2aaaaa1b4b0ed1fe5ee12d2a 100644 (file)
@@ -12,7 +12,7 @@ Change to the directory.
   $ _autoenv_ask_for_yes() { echo "yes"; return 0 }
   $ cd .
   Attempting to load unauthorized env file!
-  -* /tmp/cramtests-*/leave.t/sub/.autoenv.zsh (glob)
+  -* /*/cramtests-*/leave.t/sub/.autoenv.zsh (glob)
   
   **********************************************
   
@@ -29,7 +29,7 @@ Leave the directory and answer "no".
   $ _autoenv_ask_for_yes() { echo "no"; return 1 }
   $ cd ..
   Attempting to load unauthorized env file!
-  -* /tmp/cramtests-*/leave.t/sub/.autoenv_leave.zsh (glob)
+  -* /*/cramtests-*/leave.t/sub/.autoenv_leave.zsh (glob)
   
   **********************************************
   
@@ -45,7 +45,7 @@ Leave the directory and answer "no".
   $ _autoenv_ask_for_yes() { echo "yes"; return 0 }
   $ cd ..
   Attempting to load unauthorized env file!
-  -* /tmp/cramtests-*/leave.t/sub/.autoenv_leave.zsh (glob)
+  -* /*/cramtests-*/leave.t/sub/.autoenv_leave.zsh (glob)
   
   **********************************************
   
index c19e6b851d4b1e10c52a9dc1541ef68d45841838..a80353065c416a21062223edef0ea86e1e907870 100644 (file)
@@ -115,7 +115,7 @@ First, let's answer "no".
   $ cd sub
   autoenv_source_parent_from_sub:
   Attempting to load unauthorized env file!
-  -* /tmp/cramtests-*/recurse-upwards.t/.autoenv.zsh (glob)
+  -* /*/cramtests-*/recurse-upwards.t/.autoenv.zsh (glob)
   
   **********************************************
   
@@ -140,7 +140,7 @@ Touching the .autoenv.zsh file will now source the parent env file.
   $ cd .
   autoenv_source_parent_from_sub:
   Attempting to load unauthorized env file!
-  -* /tmp/cramtests-*/recurse-upwards.t/.autoenv.zsh (glob)
+  -* /*/cramtests-*/recurse-upwards.t/.autoenv.zsh (glob)
   
   **********************************************
   
index 31aee201214e80dd66c3cf9bd23ffa34f405c6d6..d1e26ed51e81c627171d3bd47bc4f5ef5546ee01 100644 (file)
 
 export AUTOENV_AUTH_FILE="$CRAMTMP/autoenv/.autoenv_auth"
 
-if [[ $AUTOENV_AUTH_FILE[0,4] != '/tmp' ]]; then
-  echo "AUTOENV_AUTH_FILE is not in /tmp. Aborting."
-  return 1
-fi
-
 # Abort this setup script on any error.
 _save_errexit=${options[errexit]}
 set -e
index 01640d7bbbb90026c5f3f451b80f374d2b69b22b..bf9df476bd7215667b019db5f8830b168cd626c0 100644 (file)
@@ -19,7 +19,7 @@ This also tests that there are no empty lines being added to the auth file when
 de-authenticating the old hash.
 
   $ cat $AUTOENV_AUTH_FILE
-  :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:3679467995.13:2 (glob)
+  :/*/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:3679467995.13:2 (glob)
 
 Re-create auth file with v1 hashes for both auth files.
 
@@ -31,13 +31,13 @@ Only the leave file's hash should get updated.
   $ cd ..
   LEAVE
   $ cat $AUTOENV_AUTH_FILE
-  :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:4c403f1870af2ab5472370a42b6b2b488cefe83c:1 (glob)
-  :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv_leave.zsh:803077150.11:2 (glob)
+  :/*/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:4c403f1870af2ab5472370a42b6b2b488cefe83c:1 (glob)
+  :/*/cramtests-*/upgrade_hash.t/sub/.autoenv_leave.zsh:803077150.11:2 (glob)
 
 The enter file's hash should get updated.
 
   $ cd sub
   ENTERED
   $ cat $AUTOENV_AUTH_FILE
-  :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv_leave.zsh:803077150.11:2 (glob)
-  :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:3679467995.13:2 (glob)
+  :/*/cramtests-*/upgrade_hash.t/sub/.autoenv_leave.zsh:803077150.11:2 (glob)
+  :/*/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:3679467995.13:2 (glob)