From 2d0f95014d17fd077a3e77efe1f0bc1f72c8439e Mon Sep 17 00:00:00 2001 From: Barabas Raffai Date: Sun, 14 Feb 2021 14:32:43 +0000 Subject: [PATCH] Add tests for adopt and dotfiles interaction This will fail, as dotfiles are not adopted properly, so marked as TODO. --- t/dotfiles.t | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/t/dotfiles.t b/t/dotfiles.t index a4a45c8..ae3e8f0 100755 --- a/t/dotfiles.t +++ b/t/dotfiles.t @@ -24,7 +24,7 @@ use warnings; use testutil; -use Test::More tests => 6; +use Test::More tests => 7; use English qw(-no_match_vars); use testutil; @@ -129,3 +129,27 @@ ok( -f '../stow/dotfiles/dot-bar' && ! -e '.bar' => 'unstow a simple dotfile' ); + +# +# adopt a dot file +# + +TODO: { + local $TODO = ".file contents are wrong after getting adopted"; + + $stow = new_Stow(dir => '../stow', dotfiles => 1, 'adopt' => 1); + + make_path('../stow/vim'); + make_file('../stow/vim/dot-vimrc', "dot-vimrc contents\n"); + + make_file('.vimrc', ".vimrc contents\n"); + + $stow->plan_stow('vim'); + $stow->process_tasks(); + + is( + cat_file('.vimrc'), + ".vimrc contents\n" + => "adopt dot file has right contents" + ); +};