diff --git a/tests/.zshenv b/tests/.zshenv index 859766f..f4a97af 100644 --- a/tests/.zshenv +++ b/tests/.zshenv @@ -14,3 +14,22 @@ export ADOTDIR="$PWD/dot-antigen" rm "$TESTDIR/.zcompdump" source "$TESTDIR/../antigen.zsh" + +# A test plugin repository to test out antigen with. + +mkdir test-plugin + +# A wrapper function over `git` to work with the test plugin repo. +pg () { + git --git-dir test-plugin/.git --work-tree test-plugin "$@" +} + +cat > test-plugin/aliases.zsh < /dev/null diff --git a/tests/branch-bundle.t b/tests/branch-bundle.t index e2cc13a..ac66c34 100644 --- a/tests/branch-bundle.t +++ b/tests/branch-bundle.t @@ -1,35 +1,9 @@ -Setup a plugin. - - $ mkdir plugin - -A git wrapper that works with the plugin's repo. - - $ pg () { - > git --git-dir plugin/.git --work-tree plugin "$@" - > } - -Setup the plugin repo. - - $ pg init - Initialized empty Git repository in .+?/plugin/\.git/? (re) - -Master branch content. - - $ cat > plugin/aliases.zsh < alias hehe='echo hehe' - > EOF - $ pg add . - $ pg commit -m 'Initial commit' - \[master \(root-commit\) [a-f0-9]{7}\] Initial commit (re) - 1 file changed, 1 insertion(+) - create mode [\d]{6} aliases\.zsh (re) - Branch b1. $ pg branch b1 $ pg checkout b1 Switched to branch 'b1' - $ cat > plugin/aliases.zsh < test-plugin/aliases.zsh < alias hehe='echo hehe from b1' > EOF $ pg commit -am 'Change for b1' @@ -43,7 +17,7 @@ Go back to master. Load plugin from b1. - $ antigen-bundle $PWD/plugin --branch=b1 + $ antigen-bundle $PWD/test-plugin --branch=b1 Cloning into '.+?'\.\.\. (re) done. Switched to a new branch 'b1' @@ -53,7 +27,7 @@ Load plugin from b1. Load plugin from master. - $ antigen-bundle $PWD/plugin + $ antigen-bundle $PWD/test-plugin Cloning into '.+?'\.\.\. (re) done. $ hehe diff --git a/tests/update.t b/tests/update.t index 3849938..9dac997 100644 --- a/tests/update.t +++ b/tests/update.t @@ -1,32 +1,6 @@ -Setup a plugin. - - $ mkdir plugin - -A git wrapper that works with the plugin's repo. - - $ pg () { - > git --git-dir plugin/.git --work-tree plugin "$@" - > } - -Setup the plugin repo. - - $ pg init - Initialized empty Git repository in .+?/plugin/\.git/? (re) - -Write to the plugin. - - $ cat > plugin/aliases.zsh < alias hehe='echo hehe' - > EOF - $ pg add . - $ pg commit -m 'Initial commit' - \[master \(root-commit\) [a-f0-9]{7}\] Initial commit (re) - 1 file changed, 1 insertion(+) - create mode [\d]{6} aliases\.zsh (re) - Load plugin from master. - $ antigen-bundle $PWD/plugin + $ antigen-bundle $PWD/test-plugin Cloning into '.+?'\.\.\. (re) done. $ hehe @@ -34,7 +8,7 @@ Load plugin from master. Update the plugin. - $ cat > plugin/aliases.zsh < test-plugin/aliases.zsh < alias hehe='echo hehe, updated' > EOF $ pg commit -am 'Updated message' @@ -44,7 +18,7 @@ Update the plugin. Update bundles. $ antigen-update - From .+?/plugin (re) + From .+?/test-plugin (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