diff --git a/tests/.zshenv b/tests/.zshenv index f4a97af..d27682e 100644 --- a/tests/.zshenv +++ b/tests/.zshenv @@ -17,14 +17,15 @@ source "$TESTDIR/../antigen.zsh" # A test plugin repository to test out antigen with. -mkdir test-plugin +export PLUGIN_DIR="$PWD/test-plugin" +mkdir "$PLUGIN_DIR" # A wrapper function over `git` to work with the test plugin repo. pg () { - git --git-dir test-plugin/.git --work-tree test-plugin "$@" + git --git-dir "$PLUGIN_DIR"/.git --work-tree "$PLUGIN_DIR" "$@" } -cat > test-plugin/aliases.zsh < "$PLUGIN_DIR"/aliases.zsh < test-plugin/aliases.zsh < $PLUGIN_DIR/aliases.zsh < alias hehe='echo hehe from b1' > EOF $ pg commit -am 'Change for b1' @@ -17,7 +17,7 @@ Go back to master. Load plugin from b1. - $ antigen-bundle $PWD/test-plugin --branch=b1 + $ antigen-bundle $PLUGIN_DIR --branch=b1 Cloning into '.+?'\.\.\. (re) done. Switched to a new branch 'b1' @@ -27,7 +27,7 @@ Load plugin from b1. Load plugin from master. - $ antigen-bundle $PWD/test-plugin + $ antigen-bundle $PLUGIN_DIR Cloning into '.+?'\.\.\. (re) done. $ hehe diff --git a/tests/update.t b/tests/update.t index 9dac997..3d6e0d0 100644 --- a/tests/update.t +++ b/tests/update.t @@ -1,6 +1,6 @@ Load plugin from master. - $ antigen-bundle $PWD/test-plugin + $ antigen-bundle $PLUGIN_DIR Cloning into '.+?'\.\.\. (re) done. $ hehe @@ -8,7 +8,7 @@ Load plugin from master. Update the plugin. - $ cat > test-plugin/aliases.zsh < $PLUGIN_DIR/aliases.zsh < alias hehe='echo hehe, updated' > EOF $ pg commit -am 'Updated message' @@ -18,7 +18,7 @@ Update the plugin. Update bundles. $ antigen-update - From .+?/test-plugin (re) + From \S+? (re) [a-z0-9]{7}\.\.[a-z0-9]{7} master -> origin/master (re) Updating [a-z0-9]{7}\.\.[a-z0-9]{7} (re) Fast-forward