Commit 80d6fbe6024ea66573a1490b786f11df2a5ab2ea
1 parent
3aa0d2d8a3
Add another test plugin to the testing system.
Showing 1 changed file with 18 additions and 6 deletions Inline Diff
tests/.zshenv
| 1 | # zshrc file written for antigen's tests. Might not be a good one for daily use. | 1 | # zshrc file written for antigen's tests. Might not be a good one for daily use. |
| 2 | 2 | ||
| 3 | # See cram's documentation for some of the variables used below. | 3 | # See cram's documentation for some of the variables used below. |
| 4 | 4 | ||
| 5 | export ADOTDIR="$PWD/dot-antigen" | 5 | export ADOTDIR="$PWD/dot-antigen" |
| 6 | 6 | ||
| 7 | rm "$TESTDIR/.zcompdump" | 7 | rm "$TESTDIR/.zcompdump" |
| 8 | 8 | ||
| 9 | source "$TESTDIR/../antigen.zsh" | 9 | source "$TESTDIR/../antigen.zsh" |
| 10 | 10 | ||
| 11 | # A test plugin repository to test out antigen with. | 11 | # A test plugin repository to test out antigen with. |
| 12 | 12 | ||
| 13 | export PLUGIN_DIR="$PWD/test-plugin" | 13 | export PLUGIN_DIR="$PWD/test-plugin" |
| 14 | mkdir "$PLUGIN_DIR" | 14 | mkdir "$PLUGIN_DIR" |
| 15 | 15 | ||
| 16 | # A wrapper function over `git` to work with the test plugin repo. | 16 | # A wrapper function over `git` to work with the test plugin repo. |
| 17 | pg () { | 17 | alias pg='git --git-dir "$PLUGIN_DIR/.git" --work-tree "$PLUGIN_DIR"' |
| 18 | git --git-dir "$PLUGIN_DIR"/.git --work-tree "$PLUGIN_DIR" "$@" | ||
| 19 | } | ||
| 20 | 18 | ||
| 21 | cat > "$PLUGIN_DIR"/aliases.zsh <<EOF | 19 | echo 'alias hehe="echo hehe"' > "$PLUGIN_DIR"/aliases.zsh |
| 22 | alias hehe='echo hehe' | ||
| 23 | EOF | ||
| 24 | 20 | ||
| 25 | { | 21 | { |
| 26 | pg init | 22 | pg init |
| 27 | pg add . | 23 | pg add . |
| 28 | pg commit -m 'Initial commit' | 24 | pg commit -m 'Initial commit' |
| 29 | } > /dev/null | 25 | } > /dev/null |
| 26 | |||
| 27 | # Another test plugin. | ||
| 28 | |||
| 29 | export PLUGIN_DIR2="$PWD/test-plugin2" | ||
| 30 | mkdir "$PLUGIN_DIR2" | ||
| 31 | |||
| 32 | # A wrapper function over `git` to work with the test plugin repo. | ||
| 33 | alias pg2='git --git-dir "$PLUGIN_DIR2/.git" --work-tree "$PLUGIN_DIR2"' | ||
| 34 | |||
| 35 | echo 'alias hehe="echo hehe2"' > "$PLUGIN_DIR2"/aliases.zsh | ||
| 36 | |||
| 37 | { | ||
| 38 | pg2 init |