]> Sergey Matveev's repositories - zsh-autoenv.git/blob - tests/varstash-unstash-on-leave.t
Set varstash_dir for "leave" event (#72)
[zsh-autoenv.git] / tests / varstash-unstash-on-leave.t
1 Test unstash behavior on leaving.
2
3   $ source $TESTDIR/setup.zsh || return 1
4
5 Setup test environment.
6
7   $ mkdir sub
8   $ echo 'echo ENTER; stash FOO=changed' >| sub/$AUTOENV_FILE_ENTER
9   $ echo 'echo LEAVE; unstash FOO' >| sub/$AUTOENV_FILE_LEAVE
10   $ test_autoenv_auth_env_files sub
11   $ FOO=orig
12
13 Activating the env stashes it and applies a new value.
14
15   $ cd sub
16   ENTER
17   $ echo $FOO
18   changed
19
20 Leaving the directory unstashes it (varstash_dir is set to prev dir).
21
22   $ cd ..
23   LEAVE
24   $ echo $FOO
25   orig