1 $ source $TESTDIR/setup.sh
3 Lets set a simple .env action
5 $ echo 'echo ENTERED' >> .env
7 Manually create auth file
9 $ test_autoenv_add_to_env $PWD/.env
13 Now try to make it accept it
15 $ unset _autoenv_stack_entered
16 $ rm $AUTOENV_ENV_FILENAME
17 $ _autoenv_ask_for_yes() { echo "yes" }
19 Attempting to load unauthorized env file!
20 -* /tmp/cramtests-*/autoenv.t/.env (glob)
22 **********************************************
26 **********************************************
28 Would you like to authorize it? (type 'yes') yes
32 The last "ENTERED" is because it executed the command.
34 Now lets see that it actually checks the shasum value.
36 $ unset _autoenv_stack_entered
40 $ unset _autoenv_stack_entered
41 $ rm $AUTOENV_ENV_FILENAME
42 $ test_autoenv_add_to_env $PWD/.env mischief
44 Attempting to load unauthorized env file!
45 -* /tmp/cramtests-*/autoenv.t/.env (glob)
47 **********************************************
51 **********************************************
53 Would you like to authorize it? (type 'yes') yes
57 Now, will it take no for an answer?
59 $ unset _autoenv_stack_entered
60 $ rm $AUTOENV_ENV_FILENAME
61 $ _autoenv_ask_for_yes() { echo "no"; return 1 }
63 Attempting to load unauthorized env file!
64 -* /tmp/cramtests-*/autoenv.t/.env (glob)
66 **********************************************
70 **********************************************
72 Would you like to authorize it? (type 'yes') no
75 Lets also try one more time to ensure it didn't add it.
78 Attempting to load unauthorized env file!
79 -* /tmp/cramtests-*/autoenv.t/.env (glob)
81 **********************************************
85 **********************************************
87 Would you like to authorize it? (type 'yes') no