X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02git_object.t;h=bb49cf799be1a02d23edb86e52398232be77578b;hb=e66671b8417cbfd3fb6dd22ffff9ab338f248e53;hp=750398e520d9c1a38668fe9c5175ff4bbdbd77d2;hpb=65ffc9fb8f3438e5b9ebded39b172e9f817ccef5;p=catagits%2FGitalist.git diff --git a/t/02git_object.t b/t/02git_object.t index 750398e..bb49cf7 100644 --- a/t/02git_object.t +++ b/t/02git_object.t @@ -59,7 +59,7 @@ my $commit_obj = Gitalist::Git::Object::Commit->new( isa_ok($commit_obj, 'Gitalist::Git::Object::Commit', "commit object"); my ($tree, $patch) = $commit_obj->diff( parent => undef, - file => undef, + filename => undef, patch => 1, ); $patch = $patch->[0]; @@ -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;