summaryrefslogtreecommitdiff
path: root/test/rcup-hooks.t
diff options
context:
space:
mode:
authorGravatar Ben Turrubiates <ben@turrubiat.es>2014-12-14 23:33:24 -0600
committerGravatar Mike Burns <mike@mike-burns.com>2015-01-07 16:49:52 +0100
commit40bb6efaa7865e6cebdf8aa00e6bd2a44b928a31 (patch)
tree89d910e6624465cf89b42ce57daf23ee7f92d8ed /test/rcup-hooks.t
parent366dd721483e6dd55e1da1ca7aa6caa3efc19261 (diff)
Run hooks on rcdn as indicated by the manpage
- Make sure IFS in rcup and rcdn isn't left in an incorrect state when the output of lsrc is empty. - Add tests to check that hooks run on rcdn and rcup by default.
Diffstat (limited to 'test/rcup-hooks.t')
-rw-r--r--test/rcup-hooks.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/rcup-hooks.t b/test/rcup-hooks.t
new file mode 100644
index 0000000..8890f7b
--- /dev/null
+++ b/test/rcup-hooks.t
@@ -0,0 +1,18 @@
+ $ . "$TESTDIR/helper.sh"
+
+Pre-up and post-up hooks should run by default
+
+ $ mkdir -p .dotfiles/hooks
+ > touch .dotfiles/hooks/pre-up .dotfiles/hooks/post-up
+ > chmod +x .dotfiles/hooks/pre-up .dotfiles/hooks/post-up
+
+ $ echo 'echo "example" > /tmp/test' > .dotfiles/hooks/pre-up
+ > echo 'cat /tmp/test; rm /tmp/test' > .dotfiles/hooks/post-up
+
+ $ rcup
+ example
+
+Ensure that hooks run when output of lsrc is non-empty
+ $ touch .dotfiles/testrc
+ > rcup
+ example