diff options
Diffstat (limited to 'test/mkrc-no-symlinks.t')
-rw-r--r-- | test/mkrc-no-symlinks.t | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/mkrc-no-symlinks.t b/test/mkrc-no-symlinks.t new file mode 100644 index 0000000..e37d56a --- /dev/null +++ b/test/mkrc-no-symlinks.t @@ -0,0 +1,26 @@ + $ . "$TESTDIR/helper.sh" + +Passing a linked file is rejected. +We need a second path not under what will be $HOME + + $ EXTDIR="${CRAMTMP}2" + > mkdir -p "$EXTDIR" + > echo 'Content' > "$EXTDIR/example" + > ln -s "$EXTDIR/example" "$HOME/.example" + + $ mkrc .example + '.example' is a symlink. Cannot process file. + [1] + + $ refute "is a symlink" -h $HOME/.dotfiles/.example + +Passing a file in one linked dir is rejected + + $ mkdir "$HOME/.config" + > ln -s "$EXTDIR/" "$HOME/.config/tmpdir" + + $ mkrc -v .config/tmpdir/example + '.config/tmpdir/example' path contains a symlink (tmpdir). Cannot process file. + [1] + + $ refute "is a symlink" -h "$HOME/.dotfiles/config/tmpdir/example" |