diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-02-07 23:43:50 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-02-07 23:43:50 -0700 |
commit | 4ee46956d3ed75bb3516a0e07a1235ef3c6c09ef (patch) | |
tree | b82aca1fc27fe78dd0dfbef5defa697f01299c36 /t | |
parent | 2ed222c8ea789702b2aeffd63e177abd08f21b80 (diff) | |
download | p5-Git-Annex-4ee46956d3ed75bb3516a0e07a1235ef3c6c09ef.tar.gz |
convert remaining two scripts to App:: modules
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 't')
-rwxr-xr-x | t/22_annex-to-annex-dropunused.t | 24 | ||||
-rwxr-xr-x | t/23_annex-to-annex-reinject.t | 15 |
2 files changed, 14 insertions, 25 deletions
diff --git a/t/22_annex-to-annex-dropunused.t b/t/22_annex-to-annex-dropunused.t index c8bd47a..41db816 100755 --- a/t/22_annex-to-annex-dropunused.t +++ b/t/22_annex-to-annex-dropunused.t @@ -5,6 +5,8 @@ use strict; use warnings; use lib 't/lib'; +use App::annex_to_annex; +use App::annex_to_annex_dropunused; use Test::More; use File::Spec::Functions qw(rel2abs); use t::Setup; @@ -15,22 +17,14 @@ use File::Copy qw(copy); plan skip_all => "device ID issues" if device_id_issues; -# make sure that `make test` will always use the right version of the -# script we seek to test -my $a2a = "annex-to-annex"; -my $a2a_du = "annex-to-annex-dropunused"; -$a2a = rel2abs "blib/script/annex-to-annex" if -x "blib/script/annex-to-annex"; -$a2a_du = rel2abs "blib/script/annex-to-annex-dropunused" - if -x "blib/script/annex-to-annex-dropunused"; - with_temp_annexes { my (undef, undef, $source2) = @_; - system $a2a, qw(--commit source1/foo source2/other dest); + run_bin qw(annex-to-annex --commit source1/foo source2/other dest); { local $CWD = "source2"; - system $a2a_du; + run_bin "annex-to-annex-dropunused"; $source2->checkout("master~1"); ok((lstat "other" and not stat "other"), "other was dropped"); } @@ -39,7 +33,7 @@ with_temp_annexes { with_temp_annexes { my (undef, undef, $source2) = @_; - system $a2a, qw(--commit source1/foo source2/other dest); + run_bin qw(annex-to-annex --commit source1/foo source2/other dest); { local $CWD = "source2"; @@ -55,11 +49,11 @@ with_temp_annexes { system "mv", "-f", "$other_content.tmp", $other_content; chmod 0555, dirname $other_content; - system $a2a_du; + run_bin "annex-to-annex-dropunused"; $source2->checkout("master~1"); ok((lstat "other" and stat "other"), "other was not dropped"); # $source2->checkout("master"); - # system $a2a_du, "--dest=../dest"; + # run_bin qw(annex-to-annex-dropunused --dest=../dest); # $source2->checkout("master~1"); # ok((lstat "other" and not stat "other"), "other was dropped"); } @@ -68,7 +62,7 @@ with_temp_annexes { # with_temp_annexes { # my (undef, undef, $source2, $dest) = @_; -# system $a2a, qw(--commit source1/foo source2/other dest); +# run_bin qw(annex-to-annex --commit source1/foo source2/other dest); # $dest->annex(qw(drop --force other)); # { @@ -85,7 +79,7 @@ with_temp_annexes { # system "mv", "-f", "$other_content.tmp", $other_content; # chmod 0555, dirname $other_content; -# system $a2a_du, "--dest=../dest"; +# run_bin qw(annex-to-annex-dropunused --dest=../dest); # $source2->checkout("master~1"); # ok((lstat "other" and stat "other"), "other was not dropped"); # } diff --git a/t/23_annex-to-annex-reinject.t b/t/23_annex-to-annex-reinject.t index 2e672ea..5791c81 100755 --- a/t/23_annex-to-annex-reinject.t +++ b/t/23_annex-to-annex-reinject.t @@ -5,23 +5,18 @@ use strict; use warnings; use lib 't/lib'; +use App::annex_to_annex; +use App::annex_to_annex_reinject; use Test::More; use File::Spec::Functions qw(rel2abs); use t::Setup; +use t::Util; use File::chdir; -# make sure that `make test` will always use the right version of the -# script we seek to test -my $a2a = "annex-to-annex"; -my $a2a_ri = "annex-to-annex-reinject"; -$a2a = rel2abs "blib/script/annex-to-annex" if -x "blib/script/annex-to-annex"; -$a2a_ri = rel2abs "blib/script/annex-to-annex-reinject" - if -x "blib/script/annex-to-annex-reinject"; - with_temp_annexes { my (undef, undef, $source2) = @_; - system $a2a, qw(--commit source1/foo source2/other dest); + run_bin qw(annex-to-annex --commit source1/foo source2/other dest); { local $CWD = "source2"; $source2->checkout("master~1"); @@ -29,7 +24,7 @@ with_temp_annexes { "other is initially present"; $source2->checkout("master"); } - system $a2a_ri, qw(source2 dest); + run_bin qw(annex-to-annex-reinject source2 dest); { local $CWD = "source2"; $source2->checkout("master~1"); |