]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - t/20-each.t
Update VPIT::TestHelpers to 15e8aee3
[perl/modules/rgit.git] / t / 20-each.t
index 346f755955a98cec923acb599c0505be67791ffe..a5ac4d3e167846900984a49b0457a2dd37349f8d 100644 (file)
@@ -3,18 +3,18 @@
 use strict;
 use warnings;
 
-use Cwd                   qw/cwd abs_path/;
-use File::Spec::Functions qw/catdir catfile/;
-use File::Temp            qw/tempfile tempdir/;
+use Cwd        qw<cwd abs_path>;
+use File::Spec (); # catdir, catfile
+use File::Temp qw<tempfile tempdir>;
 
 use Test::More;
 
-use App::Rgit::Utils qw/:codes/;
+use App::Rgit::Utils qw<:codes>;
 use App::Rgit;
 
 use lib 't/lib';
 
-use App::Rgit::TestUtils qw/can_run_git/;
+use App::Rgit::TestUtils qw<can_run_git>;
 use App::Rgit::Policy::Callback;
 
 my ($can_run, $reason) = can_run_git;
@@ -33,7 +33,7 @@ sub build {
 
  while (my ($d, $v) = each %$tree) {
   if (ref $v) {
-   my $dir = catdir($prefix, $d);
+   my $dir = File::Spec->catdir($prefix, $d);
    mkdir $dir or die "mkdir($dir): $!";
 
    my @r = build($v, $dir);
@@ -43,12 +43,12 @@ sub build {
      push @ret, [
       $_->[0],
       ref eq 'main' ? @{$_}[1 .. 3]
-                    : map catdir($d, $_), @{$_}[1 .. 3]
+                    : map File::Spec->catdir($d, $_), @{$_}[1 .. 3]
      ];
     }
    }
   } else {
-   my $file = catfile($prefix, $d);
+   my $file = File::Spec->catfile($prefix, $d);
    open my $fh, '>', $file or die "open($file): $!";
    print $fh $v;
    close $fh;
@@ -67,8 +67,8 @@ my $repogit = {
 sub repo {
  my ($n, $bare) = @_;
 
- return $bare ? [ $n, "$n.git",           "$n.git", "$n.git" ]
-              : [ $n, catdir($n, '.git'), $n,       "$n.git" ]
+ return $bare ? [ $n, "$n.git",                       "$n.git", "$n.git" ]
+              : [ $n, File::Spec->catdir($n, '.git'), $n,       "$n.git" ]
 }
 
 my $tmpdir = tempdir(CLEANUP => 1);
@@ -113,7 +113,7 @@ is grep({ ref eq 'ARRAY' } @expected), 3, 'all of them are array references';
 
 @expected = map [
  @$_,
- map(catdir($tmpdir, $_), @{$_}[1 .. 3]),
+ map(File::Spec->catdir($tmpdir, $_), @{$_}[1 .. 3]),
  $tmpdir,
  '%n', '%x'
 ], @expected;
@@ -129,10 +129,10 @@ sub try {
  );
 
  my $ar = App::Rgit->new(
-  git    => abs_path('t/bin/git'),
+  git    => 't/bin/git',
   root   => $tmpdir,
   cmd    => $cmd,
-  args   => [ abs_path($filename), $cmd, qw/%n %g %w %b %G %W %B %R %%n %x/ ],
+  args   => [ abs_path($filename), $cmd, qw<%n %g %w %b %G %W %B %R %%n %x> ],
   policy => $policy,
  );
  isa_ok $ar, 'App::Rgit', "each $cmd is an App::Rgit object";