]> Sergey Matveev's repositories - zsh-autoenv.git/blob - tests/cwd.t
tests: add and use test_autoenv_add_to_env and test_autoenv_auth_env_files
[zsh-autoenv.git] / tests / cwd.t
1 Test $PWD and $_dotenv_cwd.
2
3   $ source $TESTDIR/setup.sh
4
5 Setup env actions / output.
6
7   $ DOTENV_LOOK_UPWARDS=1
8   $ mkdir -p sub/sub2
9   $ cd sub
10   $ echo 'echo ENTERED: cwd:${PWD:t} ${_dotenv_cwd:t}' >> .env
11   $ echo 'echo LEFT: cwd:${PWD:t} ${_dotenv_cwd:t}' >> .env.leave
12
13 Manually create auth files.
14
15   $ test_autoenv_auth_env_files
16
17 The actual tests.
18
19   $ cd .
20   ENTERED: cwd:sub sub
21
22   $ cd ..
23   LEFT: cwd:sub cwd.t
24
25   $ cd sub/sub2
26   ENTERED: cwd:sub sub2