diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 5 | ||||
-rw-r--r-- | test/rcdn-hooks.t | 19 | ||||
-rw-r--r-- | test/rcup-hooks.t | 18 |
3 files changed, 41 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 3aec9d7..065b2d1 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -24,7 +24,10 @@ TESTS = \ rcup-hostname.t \ rcup-standalone.t \ rcup-symlink-dirs.t \ - rcup-usage.t + rcup-usage.t \ + rcdn-hooks.t \ + rcup-hooks.t + dist_check_SCRIPTS = $(TESTS) dist_check_DATA = helper.sh diff --git a/test/rcdn-hooks.t b/test/rcdn-hooks.t new file mode 100644 index 0000000..1edde40 --- /dev/null +++ b/test/rcdn-hooks.t @@ -0,0 +1,19 @@ + $ . "$TESTDIR/helper.sh" + +Pre-down and post-down hooks should run by default + + $ mkdir -p .dotfiles/hooks + > touch .dotfiles/hooks/pre-down .dotfiles/hooks/post-down + > chmod +x .dotfiles/hooks/pre-down .dotfiles/hooks/post-down + + $ echo 'echo "example" > /tmp/test' > .dotfiles/hooks/pre-down + > echo 'cat /tmp/test; rm /tmp/test' > .dotfiles/hooks/post-down + + $ rcdn + example + +Ensure that hooks run when output of lsrc is non-empty + $ touch .dotfiles/testrc + > rcup + > rcdn + example 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 |