6 use Cwd qw/cwd abs_path/;
7 use File::Spec::Functions qw/catdir/;
8 use File::Temp qw/tempfile/;
10 use Test::More tests => 3 * 2;
18 [ [ 'a', 'a/.git', 'a', 'a.git' ] ],
19 [ [ 'b', 'b.git', 'b.git', 'b.git' ] ],
21 [ 'c', 'x/c/.git', 'x/c', 'x/c.git' ],
22 [ 'd', 'y/d.git', 'y/d.git', 'y/d.git' ],
28 map { catdir $cwd, 't', 'repos', sprintf("%02d", $_) } 1 .. $n);
30 for my $a (@{$expected[$i]}) {
31 $a->[$_+3] = catdir($repos[$i], $a->[$_]) for 1 .. 3;
32 push @$a, $repos[$i], '^';
37 my ($fh, $filename) = tempfile(UNLINK => 1);
38 my $exit = App::Rgit->new(
39 git => abs_path('t/bin/git'),
42 args => [ abs_path($filename), 'commit', qw/^n ^g ^w ^b ^G ^W ^B ^R ^^/ ]
44 is($exit, 0, "each $_ returned 0");
45 my @lines = sort split /\n/, do { local $/; <$fh> };
46 my $res = [ map [ split /\|/, $_ ], @lines ];
47 my $exp = [ map [ 'commit', @$_ ], @{$expected[$_]} ];
48 is_deeply($res, $exp, "each $_ did the right thing");