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:
parent
34421ba5cf
commit
723ddcf3a4
1 changed files with 13 additions and 14 deletions
27
t/dotfiles.t
27
t/dotfiles.t
|
@ -48,7 +48,7 @@ subtest('adjust_dotfile()', sub {
|
||||||
|
|
||||||
my $stow;
|
my $stow;
|
||||||
|
|
||||||
subtest("stow a dotfile marked with 'dot' prefix", sub {
|
subtest("stow dot-foo as .foo", sub {
|
||||||
plan tests => 1;
|
plan tests => 1;
|
||||||
$stow = new_Stow(dir => '../stow', dotfiles => 1);
|
$stow = new_Stow(dir => '../stow', dotfiles => 1);
|
||||||
make_path('../stow/dotfiles');
|
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;
|
plan tests => 1;
|
||||||
$stow = new_Stow(dir => '../stow', dotfiles => 0);
|
$stow = new_Stow(dir => '../stow', dotfiles => 0);
|
||||||
make_path('../stow/dotfiles');
|
make_path('../stow/dotfiles');
|
||||||
|
@ -76,10 +76,9 @@ subtest("ensure that turning off dotfile processing links files as usual", sub {
|
||||||
'../stow/dotfiles/dot-foo',
|
'../stow/dotfiles/dot-foo',
|
||||||
=> 'unprocessed dotfile'
|
=> 'unprocessed dotfile'
|
||||||
);
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
subtest("stow folder marked with 'dot' prefix", sub {
|
subtest("stow dot-emacs dir as .emacs", sub {
|
||||||
plan tests => 1;
|
plan tests => 1;
|
||||||
$stow = new_Stow(dir => '../stow', dotfiles => 1);
|
$stow = new_Stow(dir => '../stow', dotfiles => 1);
|
||||||
|
|
||||||
|
@ -91,11 +90,11 @@ subtest("stow folder marked with 'dot' prefix", sub {
|
||||||
is(
|
is(
|
||||||
readlink('.emacs'),
|
readlink('.emacs'),
|
||||||
'../stow/dotfiles/dot-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;
|
plan tests => 1;
|
||||||
$stow = new_Stow(dir => '../stow', dotfiles => 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(
|
is(
|
||||||
readlink('.emacs.d/init.el'),
|
readlink('.emacs.d/init.el'),
|
||||||
'../../stow/dotfiles/dot-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;
|
plan tests => 1;
|
||||||
$stow = new_Stow(dir => '../stow', dotfiles => 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(
|
is(
|
||||||
readlink('.emacs.d/.emacs.d'),
|
readlink('.emacs.d/.emacs.d'),
|
||||||
'../../stow/dotfiles/dot-emacs.d/dot-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;
|
plan tests => 1;
|
||||||
$stow = new_Stow(dir => '../stow', dotfiles => 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(
|
is(
|
||||||
readlink('./.one/.two/three'),
|
readlink('./.one/.two/three'),
|
||||||
'../../../stow/dotfiles/dot-one/dot-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;
|
plan tests => 3;
|
||||||
$stow = new_Stow(dir => '../stow', dotfiles => 1);
|
$stow = new_Stow(dir => '../stow', dotfiles => 1);
|
||||||
|
|
||||||
|
@ -186,7 +185,7 @@ subtest("simple unstow scenario", sub {
|
||||||
ok(! -e '.bar' => 'unstow a simple dotfile');
|
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;
|
plan tests => 4;
|
||||||
$stow = new_Stow(dir => '../stow', dotfiles => 1);
|
$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);
|
is($stow->get_conflict_count, 0);
|
||||||
ok(-f '../stow/dotfiles/dot-emacs.d/init.el');
|
ok(-f '../stow/dotfiles/dot-emacs.d/init.el');
|
||||||
ok(! -e '.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');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue