1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-11-12 20:20:59 +02:00
zsh-autoenv/tests/cwd.t
Daniel Hahler bcec00d2dd Use AUTOENV prefix
- s/DOTENV_/AUTOENV_/
 - s/dotenv_/autoenv_/

Ref: https://github.com/Tarrasch/zsh-autoenv/issues/6
2014-11-24 20:13:18 +01:00

27 lines
595 B
Raku

Test $PWD, $_autoenv_from_dir and _autoenv_to_dir.
$ source $TESTDIR/setup.sh
Setup env actions / output.
$ AUTOENV_LOOK_UPWARDS=1
$ mkdir -p sub/sub2
$ cd sub
$ echo 'echo ENTERED: PWD:${PWD:t} from:${_autoenv_from_dir:t} to:${_autoenv_to_dir:t}' > .env
$ echo 'echo LEFT: PWD:${PWD:t} from:${_autoenv_from_dir:t} to:${_autoenv_to_dir:t}' > .env.leave
Manually create auth files.
$ test_autoenv_auth_env_files
The actual tests.
$ cd .
ENTERED: PWD:sub from:sub to:sub
$ cd ..
LEFT: PWD:sub from:sub to:cwd.t
$ cd sub/sub2
ENTERED: PWD:sub2 from:cwd.t to:sub2