X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02git_object.t;h=3a1ad627ff55ea69fc2f2f2d8de631a3e3ede357;hb=036b1831e295925f6aea46544ce55d14254f1392;hp=55075f05a2949662a02d54b3d8f1fd91adfb3e4f;hpb=377bf3601a002524e6dc5ead9f73e949ac2a76ca;p=catagits%2FGitalist.git diff --git a/t/02git_object.t b/t/02git_object.t index 55075f0..3a1ad62 100644 --- a/t/02git_object.t +++ b/t/02git_object.t @@ -1,7 +1,7 @@ use strict; use warnings; use FindBin qw/$Bin/; -use Test::More qw/no_plan/; +use Test::More; use Test::Exception; use Data::Dumper; @@ -78,11 +78,15 @@ is($patch->{diff}, '--- a/file1 ', 'patch->{diff} is correct'); is($patch->{dst}, '5716ca5987cbf97d6bb54920bea6adde242d87e6', 'patch->{dst} is correct'); -is($commit_obj->patch, 'From 3f7567c7bdf7e7ebf410926493b92d398333116e Mon Sep 17 00:00:00 2001 +ok(index(do { local $/; my $fh = $commit_obj->get_patch; <$fh> }, +'From 3f7567c7bdf7e7ebf410926493b92d398333116e Mon Sep 17 00:00:00 2001 From: Florian Ragwitz Date: Tue, 6 Mar 2007 20:39:45 +0100 Subject: [PATCH] bar +--- + file1 | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/file1 b/file1 index 257cc56..5716ca5 100644 @@ -91,4 +95,10 @@ index 257cc56..5716ca5 100644 @@ -1 +1 @@ -foo +bar -', 'commit_obj->patch is correct'); +--') == 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'); + +done_testing; +