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;
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);
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;
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);
@expected = map [
@$_,
- map(catdir($tmpdir, $_), @{$_}[1 .. 3]),
+ map(File::Spec->catdir($tmpdir, $_), @{$_}[1 .. 3]),
$tmpdir,
'%n', '%x'
], @expected;
my ($fh, $filename) = tempfile(UNLINK => 1);
my $policy = App::Rgit::Policy->new(
- @_ > 2 ? (name => 'Callback', callback => $_[2])
- : (name => 'Default')
+ @_ > 2 ? (policy => 'Callback', callback => $_[2])
+ : (policy => 'Default')
);
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/ ],