[Bps-public-commit] net-lighthouse branch, master, updated. a30f4d905b980381fe9f83377bcbc34d36ce9ad0

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Aug 31 02:40:55 EDT 2009


The branch, master has been updated
       via  a30f4d905b980381fe9f83377bcbc34d36ce9ad0 (commit)
      from  30a4872ab4803d98547036500d5b5e668b93aac5 (commit)

Summary of changes:
 lib/Net/Lighthouse/Project/Milestone.pm |   20 ++++++++++-------
 t/09-milestone.t                        |   36 +++++++++++++++++++++++-------
 2 files changed, 39 insertions(+), 17 deletions(-)

- Log -----------------------------------------------------------------
commit a30f4d905b980381fe9f83377bcbc34d36ce9ad0
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Aug 31 14:40:40 2009 +0800

    update milestone attrs

diff --git a/lib/Net/Lighthouse/Project/Milestone.pm b/lib/Net/Lighthouse/Project/Milestone.pm
index a31b25e..4c86ad0 100644
--- a/lib/Net/Lighthouse/Project/Milestone.pm
+++ b/lib/Net/Lighthouse/Project/Milestone.pm
@@ -5,16 +5,20 @@ use Params::Validate ':all';
 use Net::Lighthouse::Util;
 extends 'Net::Lighthouse';
 # read only attr
-has [
-    'open_tickets_count', 'created_at',
-    'goals_html',            'user_name',
-    'permalink',             'project_id',
-    'tickets_count',      'url',
-    'updated_at',            'id',
-  ] => (
+has [qw/created_at updated_at/] => (
+    isa => 'Maybe[DateTime]',
+    is  => 'ro',
+);
+
+has [qw/open_tickets_count id project_id tickets_count/] => (
+    isa => 'Int',
+    is  => 'ro',
+);
+
+has [ 'goals_html', 'user_name', 'permalink', 'url', ] => (
     isa => 'Maybe[Str]',
     is  => 'ro',
-  );
+);
 
 # read&write attr
 has [qw/title goals due_on/] => (
diff --git a/t/09-milestone.t b/t/09-milestone.t
index a945e6b..3f0bd55 100644
--- a/t/09-milestone.t
+++ b/t/09-milestone.t
@@ -49,19 +49,37 @@ my $load = $n1->load(1);
 is( $load, $n1, 'load return $self' );
 my %hash = (
     'account'            => 'sunnavy',
-    'due_on'             => '2009-08-31T00:00:00Z',
+    'due_on' => DateTime->new(
+        year  => 2009,
+        month => 8,
+        day   => 31,
+    ),
     'user_name'          => undef,
     'permalink'          => 'first-release',
     'goals_html'         => '<div><p>release 1st version</p></div>',
-    'created_at'         => '2009-08-27T02:07:15Z',
-    'updated_at'         => '2009-08-27T02:07:15Z',
-    'open_tickets_count' => '0',
-    'tickets_count'      => '0',
+    'created_at' => DateTime->new(
+        year   => 2009,
+        month  => 8,
+        day    => 27,
+        hour   => 2,
+        minute => 7,
+        second => 15,
+    ),
+    'updated_at'         => DateTime->new(
+        year   => 2009,
+        month  => 8,
+        day    => 27,
+        hour   => 2,
+        minute => 7,
+        second => 15,
+    ),
+    'open_tickets_count' => 0,
+    'tickets_count'      => 0,
     'url' => 'http://sunnavy.lighthouseapp.com/projects/35918/milestones/48761',
-    'id'  => '48761',
+    'id'  => 48761,
     'title'      => 'first release',
     'goals'      => 'release 1st version',
-    'project_id' => '35918'
+    'project_id' => 35918,
 
 );
 
@@ -98,9 +116,9 @@ $milestone = Net::Lighthouse::Project::Milestone->new(
     project_id => 35918,
 );
 my $expect_initial_state = {
-    'due_on'             => '',
+    'due_on'             => undef,
     'permalink'          => '',
-    'created_at'         => '',
+    'created_at'         => undef,
     'goals_html'         => '',
     'open_tickets_count' => '0',
     'tickets_count'      => '0',

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list