From: Tomas Doran Date: Sun, 27 Dec 2009 17:21:50 +0000 (+0000) Subject: Fix test on older git versions X-Git-Tag: 0.000005~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0af41853c8ea233bb8ce7b1a20f8ae8e33eb111d;p=catagits%2FGitalist.git Fix test on older git versions --- diff --git a/t/02git_object.t b/t/02git_object.t index 750398e..3cdc2cc 100644 --- a/t/02git_object.t +++ b/t/02git_object.t @@ -97,8 +97,11 @@ index 257cc56..5716ca5 100644 +bar --') == 0, 'commit_obj->get_patch can return a patch'); -like(do { local $/; my $fh = $commit_obj->get_patch(undef, 3); <$fh> }, - qr!PATCH 2/2!, 'commit_obj->get_patch can return a patchset'); - +# Note - 2 patches = 3 parts due to where we split. +{ + my @bits = split /Subject: \[PATC/, do { local $/; my $fh = $commit_obj->get_patch(undef, 3); <$fh> }; + is(scalar(@bits), 3, + 'commit_obj->get_patch can return a patchset'); +} done_testing;