]> Dogcows Code - chaz/git-codeowners/blobdiff - t/app-codeowners.t
add projects command and filtering to show command
[chaz/git-codeowners] / t / app-codeowners.t
index 8be4287d30487e23e29d1cead3ce4734b153104d..28309d3861ca0b802cf938133128494302850377 100644 (file)
@@ -65,7 +65,7 @@ END
     subtest 'format json' => sub {
         plan skip_all => 'No JSON::MaybeXS' if !eval { require JSON::MaybeXS };
 
-        ($stdout, $stderr, $exit) = run { App::Codeowners->main(qw{-f json show --no-project}) };
+        ($stdout, $stderr, $exit) = run { App::Codeowners->main(qw{-f json show --no-projects}) };
         is($exit, 0, 'exited without error');
         my $expect = '[{"File":"CODEOWNERS","Owner":null},{"File":"a/b/c/bar.txt","Owner":["@snickers"]},{"File":"foo.txt","Owner":["@twix"]}]';
         is($stdout, $expect, 'correct output with json format');
@@ -76,7 +76,8 @@ done_testing;
 exit;
 
 sub _can_git {
-    my ($version) = run_git('--version');
+    my (undef, $version) = eval { run_git('--version') };
+    note $@ if $@;
     note "Found: $version" if $version;
     return $version && $version ge 'git version 1.8.5';     # for -C flag
 }
@@ -93,9 +94,9 @@ sub _setup_git_repo {
 a/  @snickers
 END
 
-    run_git('-C', $repodir, qw{init});
-    run_git('-C', $repodir, qw{add .});
-    run_git('-C', $repodir, qw{commit -m}, 'initial commit');
+    run_git('-C', $repodir, qw{init})->wait;
+    run_git('-C', $repodir, qw{add .})->wait;
+    run_git('-C', $repodir, qw{commit -m}, 'initial commit')->wait;
 
     return $repodir;
 }
This page took 0.028929 seconds and 4 git commands to generate.