[Bps-public-commit] r19732 - in Net-Google-Code/trunk: lib/Net/Google/Code

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed May 20 00:22:31 EDT 2009


Author: sunnavy
Date: Wed May 20 00:22:31 2009
New Revision: 19732

Modified:
   Net-Google-Code/trunk/lib/Net/Google/Code/Issue.pm
   Net-Google-Code/trunk/t/02.issue.t

Log:
add updated attr for issue

Modified: Net-Google-Code/trunk/lib/Net/Google/Code/Issue.pm
==============================================================================
--- Net-Google-Code/trunk/lib/Net/Google/Code/Issue.pm	(original)
+++ Net-Google-Code/trunk/lib/Net/Google/Code/Issue.pm	Wed May 20 00:22:31 2009
@@ -218,6 +218,12 @@
 
 }
 
+# the issue's last modified date, return a DateTime object
+sub updated {
+    my $self = shift;
+    return $self->comments->[-1]->date;
+}
+
 sub create {
     my $self = shift;
     my %args = validate(
@@ -380,6 +386,8 @@
 
 =item reported
 
+=item updated
+
 =item merged
 
 =item closed

Modified: Net-Google-Code/trunk/t/02.issue.t
==============================================================================
--- Net-Google-Code/trunk/t/02.issue.t	(original)
+++ Net-Google-Code/trunk/t/02.issue.t	Wed May 20 00:22:31 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 18;
+use Test::More tests => 19;
 use Test::MockModule;
 
 # $content is a real page: http://code.google.com/p/chromium/issues/detail?id=14
@@ -89,3 +89,5 @@
 # http://code.google.com/p/chromium/issues/detail?id=683
 is( scalar @{ $issue->attachments }, 3, 'attachments are extracted' );
 is( $issue->attachments->[0]->size, '11.7 KB', 'size of the 1st attachment' );
+
+is( $issue->updated, '2008-12-19T17:59:29', 'updated' );



More information about the Bps-public-commit mailing list