summaryrefslogtreecommitdiff
path: root/test/rcup-hooks.t
diff options
context:
space:
mode:
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