From 0952e605da4b5aebfdc7fe9b792af5730b45a0be Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Fri, 20 Jul 2012 16:50:26 +0530 Subject: [PATCH] Separate and more tests for -update command. --- tests/bundle.t | 26 -------------------------- tests/update.t | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 26 deletions(-) create mode 100644 tests/update.t diff --git a/tests/bundle.t b/tests/bundle.t index 0906783..7a99a18 100644 --- a/tests/bundle.t +++ b/tests/bundle.t @@ -12,33 +12,7 @@ Load the plugin again. Just to see nothing happens. $ hehe hehe -Update the plugin. - - $ cat > $PLUGIN_DIR/aliases.zsh < alias hehe='echo hehe, updated' - > EOF - $ pg commit -am 'Updated message' - \[master [a-f0-9]{7}\] Updated message (re) - 1 file changed, 1 insertion(+), 1 deletion(-) - -Update bundles. - - $ antigen-update - **** Pulling */test-plugin (glob) - From */test-plugin (glob) - ???????..??????? master -> origin/master (glob) - Updating ???????..??????? (glob) - Fast-forward - aliases.zsh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - - Confirm there is still only one repository. $ ls $ADOTDIR/repos | wc -l 1 - -The new alias should not activate. - - $ hehe - hehe diff --git a/tests/update.t b/tests/update.t new file mode 100644 index 0000000..6e5da88 --- /dev/null +++ b/tests/update.t @@ -0,0 +1,49 @@ +Load plugin. + + $ antigen-bundle $PLUGIN_DIR + Cloning into '.+?'\.\.\. (re) + done. + $ hehe + hehe + +Update the plugin. + + $ cat > $PLUGIN_DIR/aliases.zsh < alias hehe='echo hehe, updated' + > EOF + $ pg commit -am 'Updated message' + \[master [a-f0-9]{7}\] Updated message (re) + 1 file changed, 1 insertion(+), 1 deletion(-) + +Run antigen's update. + + $ antigen-update + **** Pulling */test-plugin (glob) + From */test-plugin (glob) + ???????..??????? master -> origin/master (glob) + Updating ???????..??????? (glob) + Fast-forward + aliases.zsh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + Updated from ??????? to ???????. (glob) + ??????? Updated message (glob) + aliases.zsh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + + +Confirm there is still only one repository. + + $ ls $ADOTDIR/repos | wc -l + 1 + +The new alias should not activate. + + $ hehe + hehe + +Run update again, with no changes in the origin repo. + + $ antigen-update + **** Pulling */test-plugin (glob) + Already up-to-date. + -- 2.0.0