use App::Rgit::Utils qw/:codes/;
use App::Rgit;
+use lib 't/lib';
+
+use App::Rgit::Policy::Callback;
+
sub build {
my ($tree, $prefix) = @_;
my @ret;
@$_,
map({ catdir($tmpdir, $_) } @{$_}[1 .. 3]),
$tmpdir,
- '@n', '@x'
+ '%n', '%x'
], @expected;
sub try {
- my ($cmd, $exp, $policy) = @_;
+ my ($cmd, $exp) = @_;
my ($fh, $filename) = tempfile(UNLINK => 1);
+ my $policy = App::Rgit::Policy->new(
+ @_ > 2 ? (name => 'Callback', callback => $_[2])
+ : (name => 'Default')
+ );
my $ar = App::Rgit->new(
git => abs_path('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,
);
isnt($ar, undef, "each $cmd has a defined object");