diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 37 | ||||
-rw-r--r-- | test/lsrc-hostname.t | 4 | ||||
-rw-r--r-- | test/mkrc-hostname.t | 9 | ||||
-rw-r--r-- | test/rcrc-custom.t | 2 | ||||
-rw-r--r-- | test/rcrc-hostname.t | 21 | ||||
-rw-r--r-- | test/rcup-hostname.t | 14 |
6 files changed, 69 insertions, 18 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 9cbc6b2..53dcf0b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,20 +1,23 @@ TESTS = \ - lsrc-dotfiles-dirs.t \ - lsrc-excludes.t \ - lsrc-hostname.t \ - lsrc-sigils.t \ - lsrc.t \ - lsrc-tags.t \ - lsrc-usage.t \ - mkrc-alternate-dotfiles-dir.t \ - mkrc-copy-file.t \ - mkrc-host-file.t \ - mkrc-simple-output.t \ - mkrc-tagged-file.t \ - mkrc-usage.t \ - rcrc-custom.t \ - rcrc.t \ - rcup-link-files.t \ - rcup-usage.t + lsrc-dotfiles-dirs.t \ + lsrc-excludes.t \ + lsrc-hostname.t \ + lsrc-sigils.t \ + lsrc.t \ + lsrc-tags.t \ + lsrc-usage.t \ + mkrc-alternate-dotfiles-dir.t \ + mkrc-copy-file.t \ + mkrc-host-file.t \ + mkrc-hostname.t \ + mkrc-simple-output.t \ + mkrc-tagged-file.t \ + mkrc-usage.t \ + rcrc-custom.t \ + rcrc-hostname.t \ + rcrc.t \ + rcup-link-files.t \ + rcup-hostname.t \ + rcup-usage.t LOG_COMPILER = cram diff --git a/test/lsrc-hostname.t b/test/lsrc-hostname.t index 9170c74..35ad0fe 100644 --- a/test/lsrc-hostname.t +++ b/test/lsrc-hostname.t @@ -11,3 +11,7 @@ Should include entries that match hostname $ lsrc /*/.example:/*/.dotfiles/example (glob) /*/.h-example:/*/.dotfiles/host-*/h-example (glob) + + $ lsrc -B not-hostname + /*/.example:/*/.dotfiles/example (glob) + /*/.nh-example:/*/.dotfiles/host-*/nh-example (glob) diff --git a/test/mkrc-hostname.t b/test/mkrc-hostname.t new file mode 100644 index 0000000..849af75 --- /dev/null +++ b/test/mkrc-hostname.t @@ -0,0 +1,9 @@ + $ . "$TESTDIR/helper.sh" + +Able to override the hostname + + $ touch .example + + $ mkrc -B another_thing .example >/dev/null + + $ assert_linked "$HOME/.example" "$HOME/.dotfiles/host-another_thing/example" diff --git a/test/rcrc-custom.t b/test/rcrc-custom.t index 658099d..9c1c7a3 100644 --- a/test/rcrc-custom.t +++ b/test/rcrc-custom.t @@ -1,6 +1,6 @@ $ . "$TESTDIR/helper.sh" -mkrc should accept -r for a custom rcrc +mkrc should accept a custom rcrc $ touch .example > mkdir .other-dotfiles diff --git a/test/rcrc-hostname.t b/test/rcrc-hostname.t new file mode 100644 index 0000000..1008cd9 --- /dev/null +++ b/test/rcrc-hostname.t @@ -0,0 +1,21 @@ + $ . "$TESTDIR/helper.sh" + +The hostname can be set in ~/.rcrc + + $ touch .dotfiles/example + > mkdir .dotfiles/host-$(hostname) + > touch .dotfiles/host-$(hostname)/h-example + > mkdir .dotfiles/host-eggplant_firetruck + > touch .dotfiles/host-eggplant_firetruck/nh-example + > mkdir .dotfiles/host-haircut_hammer + > touch .dotfiles/host-haircut_hammer/nh-example + + $ echo 'HOSTNAME="eggplant_firetruck"' > $HOME/.rcrc + + $ lsrc + /*/.example:/*/.dotfiles/example (glob) + /*/.nh-example:/*/.dotfiles/host-eggplant_firetruck/nh-example (glob) + + $ lsrc -B haircut_hammer + /*/.example:/*/.dotfiles/example (glob) + /*/.nh-example:/*/.dotfiles/host-haircut_hammer/nh-example (glob) diff --git a/test/rcup-hostname.t b/test/rcup-hostname.t new file mode 100644 index 0000000..b85dbb8 --- /dev/null +++ b/test/rcup-hostname.t @@ -0,0 +1,14 @@ + $ . "$TESTDIR/helper.sh" + +Should create symlinks for files and directories in the hostname + + $ touch .dotfiles/example + > mkdir .dotfiles/host-awesome_host/ + > touch .dotfiles/host-awesome_host/example2 + > mkdir .dotfiles/host-$(hostname)/ + > touch .dotfiles/host-$(hostname)/example3 + + $ rcup -B awesome_host > /dev/null + + $ assert_linked "$HOME/.example" "$HOME/.dotfiles/example" + $ assert_linked "$HOME/.example2" "$HOME/.dotfiles/host-awesome_host/example2" |