t/dotfiles.t: improve language in test names and assertion messages

We use the term "directory" (or "dir" for short) rather than "folder".
Also explicitly say whether a test is stowing or unstowing, and fix
the odd typo.
This commit is contained in:
Adam Spiers 2024-04-07 15:57:03 +01:00
parent 34421ba5cf
commit 723ddcf3a4

View file

@ -48,7 +48,7 @@ subtest('adjust_dotfile()', sub {
my $stow;
subtest("stow a dotfile marked with 'dot' prefix", sub {
subtest("stow dot-foo as .foo", sub {
plan tests => 1;
$stow = new_Stow(dir => '../stow', dotfiles => 1);
make_path('../stow/dotfiles');
@ -63,7 +63,7 @@ subtest("stow a dotfile marked with 'dot' prefix", sub {
);
});
subtest("ensure that turning off dotfile processing links files as usual", sub {
subtest("stow dot-foo as dot-foo without --dotfile enabled", sub {
plan tests => 1;
$stow = new_Stow(dir => '../stow', dotfiles => 0);
make_path('../stow/dotfiles');
@ -76,10 +76,9 @@ subtest("ensure that turning off dotfile processing links files as usual", sub {
'../stow/dotfiles/dot-foo',
=> 'unprocessed dotfile'
);
});
subtest("stow folder marked with 'dot' prefix", sub {
subtest("stow dot-emacs dir as .emacs", sub {
plan tests => 1;
$stow = new_Stow(dir => '../stow', dotfiles => 1);
@ -91,11 +90,11 @@ subtest("stow folder marked with 'dot' prefix", sub {
is(
readlink('.emacs'),
'../stow/dotfiles/dot-emacs',
=> 'processed dotfile folder'
=> 'processed dotfile dir'
);
});
subtest("process folder marked with 'dot' prefix when directory exists is target", sub {
subtest("stow dir marked with 'dot' prefix when directory exists in target", sub {
plan tests => 1;
$stow = new_Stow(dir => '../stow', dotfiles => 1);
@ -108,11 +107,11 @@ subtest("process folder marked with 'dot' prefix when directory exists is target
is(
readlink('.emacs.d/init.el'),
'../../stow/dotfiles/dot-emacs.d/init.el',
=> 'processed dotfile folder when folder exists (1 level)'
=> 'processed dotfile dir when dir exists (1 level)'
);
});
subtest("process folder marked with 'dot' prefix when directory exists is target (2 levels)", sub {
subtest("stow dir marked with 'dot' prefix when directory exists in target (2 levels)", sub {
plan tests => 1;
$stow = new_Stow(dir => '../stow', dotfiles => 1);
@ -125,11 +124,11 @@ subtest("process folder marked with 'dot' prefix when directory exists is target
is(
readlink('.emacs.d/.emacs.d'),
'../../stow/dotfiles/dot-emacs.d/dot-emacs.d',
=> 'processed dotfile folder exists (2 levels)'
=> 'processed dotfile dir exists (2 levels)'
);
});
subtest("process folder marked with 'dot' prefix when directory exists is target", sub {
subtest("stow dir marked with 'dot' prefix when directory exists in target", sub {
plan tests => 1;
$stow = new_Stow(dir => '../stow', dotfiles => 1);
@ -142,7 +141,7 @@ subtest("process folder marked with 'dot' prefix when directory exists is target
is(
readlink('./.one/.two/three'),
'../../../stow/dotfiles/dot-one/dot-two/three',
=> 'processed dotfile 2 folder exists (2 levels)'
=> 'processed dotfile 2 dir exists (2 levels)'
);
});
@ -171,7 +170,7 @@ subtest("dot-. should not have that part expanded.", sub {
);
});
subtest("simple unstow scenario", sub {
subtest("unstow .bar from dot-bar", sub {
plan tests => 3;
$stow = new_Stow(dir => '../stow', dotfiles => 1);
@ -186,7 +185,7 @@ subtest("simple unstow scenario", sub {
ok(! -e '.bar' => 'unstow a simple dotfile');
});
subtest("unstow process folder marked with 'dot' prefix when directory exists is target", sub {
subtest("unstow dot-emacs.d/init.el when .emacs.d/init.el in target", sub {
plan tests => 4;
$stow = new_Stow(dir => '../stow', dotfiles => 1);
@ -200,5 +199,5 @@ subtest("unstow process folder marked with 'dot' prefix when directory exists is
is($stow->get_conflict_count, 0);
ok(-f '../stow/dotfiles/dot-emacs.d/init.el');
ok(! -e '.emacs.d/init.el');
ok(-d '.emacs.d/' => 'unstow dotfile folder when folder already exists');
ok(-d '.emacs.d/' => 'unstow dotfile dir when dir already exists');
});