1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-11-05 01:10:59 +02:00

Add a test for autostashing aliases (#44)

Ref: https://github.com/Tarrasch/zsh-autoenv/issues/43
This commit is contained in:
Daniel Hahler 2016-11-29 15:46:50 +01:00 committed by Arash Rouhani
parent 998c09addd
commit d51b8ecccc

38
tests/varstash-alias.t Normal file
View File

@ -0,0 +1,38 @@
Test varstash integration with regard to aliases.
$ source $TESTDIR/setup.zsh || return 1
Setup test environment.
$ mkdir sub
$ cd sub
$ echo 'echo ENTER' > $AUTOENV_FILE_ENTER
$ echo 'autostash alias some_alias="echo NEW_ALIAS"' >> $AUTOENV_FILE_ENTER
$ echo 'echo LEAVE' > $AUTOENV_FILE_LEAVE
$ test_autoenv_auth_env_files
Aliases should be stashed.
$ alias some_alias="echo ORIG_ALIAS"
$ some_alias
ORIG_ALIAS
$ cd .
ENTER
$ some_alias
NEW_ALIAS
$ cd ..
LEAVE
$ some_alias
ORIG_ALIAS
Aliases should be stashed, if there are also environment variables.
$ some_alias=ENV_VAR
$ some_alias
ORIG_ALIAS
$ cd sub
ENTER
$ type -w some_alias
some_alias: alias
$ echo $some_alias
ENV_VAR