From: Vincent Pit <vince@profvince.com>
Date: Tue, 7 Oct 2008 20:21:49 +0000 (+0200)
Subject: A little hack to test all contexts for App::Rgit::Command::Each::run
X-Git-Tag: v0.04~6
X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=5da16c1f7993ea81cb83c35c480344edef4f43e8;p=perl%2Fmodules%2Frgit.git

A little hack to test all contexts for App::Rgit::Command::Each::run
---

diff --git a/t/20-each.t b/t/20-each.t
index dfc139b..55e7085 100644
--- a/t/20-each.t
+++ b/t/20-each.t
@@ -103,8 +103,13 @@ sub try {
   policy => $policy,
  );
  isnt($ar, undef, "each $cmd has a defined object");
- my $exit = $ar->run;
+ my $exit;
  my $fail = $cmd eq 'FAIL' ? 1 : 0;
+ if ($fail) {
+  ($exit, undef) = $ar->run;
+ } else {
+  $exit = $ar->run;
+ }
  is($exit, $fail, "each $cmd returned $fail");
  my @lines = split /\n/, do { local $/; <$fh> };
  my $res = [ map [ split /\|/, $_ ], @lines ];