[Bps-public-commit] net-lighthouse branch, master, updated. 6d05ed54826e29dac7b8a947d592a788c23892a5
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Mon Aug 31 03:18:40 EDT 2009
The branch, master has been updated
via 6d05ed54826e29dac7b8a947d592a788c23892a5 (commit)
from a9683c3d6546b45d9e1d19169396bb5595ae9900 (commit)
Summary of changes:
lib/Net/Lighthouse/Project/TicketBin.pm | 26 +++++++++++++++++++-------
t/12-ticket-bin.t | 24 ++++++++++++++++--------
2 files changed, 35 insertions(+), 15 deletions(-)
- Log -----------------------------------------------------------------
commit 6d05ed54826e29dac7b8a947d592a788c23892a5
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon Aug 31 15:18:25 2009 +0800
update ticket bin attrs
diff --git a/lib/Net/Lighthouse/Project/TicketBin.pm b/lib/Net/Lighthouse/Project/TicketBin.pm
index 7903310..60cfebb 100644
--- a/lib/Net/Lighthouse/Project/TicketBin.pm
+++ b/lib/Net/Lighthouse/Project/TicketBin.pm
@@ -6,16 +6,28 @@ use Net::Lighthouse::Util;
extends 'Net::Lighthouse';
# read only attr
-has [
- 'user_id', 'position', 'shared', 'project_id',
- 'tickets_count', 'updated_at', 'id'
- ] => (
- isa => 'Maybe[Str]',
+has 'updated_at' => (
+ isa => 'DateTime',
+ is => 'ro',
+);
+
+has [ 'user_id', 'position', 'project_id', 'tickets_count', 'id' ] => (
+ isa => 'Int',
is => 'ro',
- );
+);
+
+has 'shared' => (
+ isa => 'Bool',
+ is => 'ro',
+);
# read&write attr
-has [qw/name query default/] => (
+has 'default' => (
+ isa => 'Bool',
+ is => 'rw',
+);
+
+has [qw/name query/] => (
isa => 'Maybe[Str]',
is => 'rw',
);
diff --git a/t/12-ticket-bin.t b/t/12-ticket-bin.t
index 1cd4cfd..3b093bd 100644
--- a/t/12-ticket-bin.t
+++ b/t/12-ticket-bin.t
@@ -3,6 +3,7 @@ use warnings;
use Test::More tests => 35;
use Test::Mock::LWP;
+use DateTime;
use_ok('Net::Lighthouse::Project');
use_ok('Net::Lighthouse::Project::TicketBin');
@@ -45,19 +46,26 @@ is( $load, $b1, 'load return $self' );
my %hash = (
'query' => 'state:open',
'account' => 'sunnavy',
- 'position' => '1',
+ 'position' => 1,
'name' => 'Open tickets',
'default' => undef,
- 'shared' => 'true',
- 'updated_at' => '2009-08-21T10:02:21Z',
- 'tickets_count' => '2',
- 'user_id' => '67166',
- 'id' => '48889',
- 'project_id' => '35918',
+ 'shared' => 1,
+ 'updated_at' => DateTime->new(
+ year => 2009,
+ month => 8,
+ day => 21,
+ hour => 10,
+ minute => 2,
+ second => 21,
+ ),
+ 'tickets_count' => 2,
+ 'user_id' => 67166,
+ 'id' => 48889,
+ 'project_id' => 35918,
);
for my $k ( keys %hash ) {
- is( $b1->$k, $hash{$k}, "$k is loaded" );
+ is_deeply( $b1->$k, $hash{$k}, "$k is loaded" );
}
$Mock_response->mock(
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list