3 use File::Temp qw( tempdir );
5 use System::Introspector::Repositories::Git;
7 plan skip_all => q{Tests require a git executable}
10 my $dir = tempdir(CLEANUP => 1);
12 no warnings 'redefine';
13 *System::Introspector::Repositories::Git::_open_locate_git_config_pipe = sub {
14 my $output = "$dir/.git/config\n";
15 open my $fh, '<', \$output;
19 system("GIT_DIR=$dir/.git git init > /dev/null");
21 my $probe = System::Introspector::Repositories::Git->new(
25 my $data = $probe->gather;
26 is scalar(keys %$data), 1, 'found single git repository';
28 my $wc = $data->{ $dir };
29 ok $wc, 'our temp repository exists in the data';
30 ok scalar(keys %{$wc->{config}||{}}), 'received config values';