mirror of
https://github.com/Tarrasch/zsh-autoenv.git
synced 2024-11-14 21:00:58 +02:00
d9ff71ac1d
- use file mtime with "entered" stack - fix loading of varstash; look at $functions - Refactor stack handling, add tests - Refactor `_autoenv_get_file_upwards`, add tests - tests: setup: reset AUTOENV_ENV_FILENAME
33 lines
498 B
Perl
33 lines
498 B
Perl
Test varstash integration.
|
|
|
|
$ source $TESTDIR/setup.sh
|
|
|
|
Setup test environment.
|
|
|
|
$ mkdir sub
|
|
$ cd sub
|
|
$ echo 'echo ENTER; autostash FOO=baz' > $AUTOENV_FILE_ENTER
|
|
$ echo 'echo LEAVE; autounstash' > $AUTOENV_FILE_LEAVE
|
|
|
|
Manually create auth file
|
|
|
|
$ test_autoenv_auth_env_files
|
|
|
|
Set environment variable.
|
|
|
|
$ FOO=bar
|
|
|
|
Activating the env stashes it and applies a new value.
|
|
|
|
$ cd .
|
|
ENTER
|
|
$ echo $FOO
|
|
baz
|
|
|
|
Leaving the directory unstashes it.
|
|
|
|
$ cd ..
|
|
LEAVE
|
|
$ echo $FOO
|
|
bar
|