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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Sep 1 09:38:52 EDT 2009


The branch, master has been updated
       via  b7087a074d850338d7b1bfcb4bc2e420004225c1 (commit)
      from  17998263b42654f2a7eff3fb8f0020587022e608 (commit)

Summary of changes:
 lib/Net/Lighthouse.pm |   12 +++++++++---
 t/01-base.t           |    3 +--
 t/02-project.t        |    1 -
 t/06-user.t           |    3 +--
 4 files changed, 11 insertions(+), 8 deletions(-)

- Log -----------------------------------------------------------------
commit b7087a074d850338d7b1bfcb4bc2e420004225c1
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Sep 1 21:38:31 2009 +0800

    make account ro

diff --git a/lib/Net/Lighthouse.pm b/lib/Net/Lighthouse.pm
index 5160652..daf1721 100644
--- a/lib/Net/Lighthouse.pm
+++ b/lib/Net/Lighthouse.pm
@@ -5,9 +5,15 @@ use MIME::Base64;
 use LWP::UserAgent;
 
 our $VERSION = '0.01';
-has ['account', 'email', 'password', 'token'] => (
-    isa      => 'Str',
-    is       => 'rw',
+
+has 'account' => (
+    isa => 'Str',
+    is  => 'ro',
+);
+
+has [ 'email', 'password', 'token' ] => (
+    isa => 'Str',
+    is  => 'rw',
 );
 
 no Any::Moose;
diff --git a/t/01-base.t b/t/01-base.t
index 3fc638f..85e167f 100644
--- a/t/01-base.t
+++ b/t/01-base.t
@@ -6,13 +6,12 @@ use MIME::Base64;
 
 use_ok('Net::Lighthouse');
 can_ok( 'Net::Lighthouse', 'new' );
-my $lh = Net::Lighthouse->new;
+my $lh = Net::Lighthouse->new( account => 'sunnavy' );
 isa_ok( $lh, 'Net::Lighthouse' );
 for (qw/account email password token base_url ua/) {
     can_ok( $lh, $_ );
 }
 
-$lh->account('sunnavy');
 is( $lh->base_url, 'http://sunnavy.lighthouseapp.com', 'base_url' );
 isa_ok( $lh->ua, 'LWP::UserAgent' );
 is(
diff --git a/t/02-project.t b/t/02-project.t
index 4dcbf23..dc818b4 100644
--- a/t/02-project.t
+++ b/t/02-project.t
@@ -42,7 +42,6 @@ for my $method (qw/ticket ticket_bin message milestone changeset/) {
     }
 }
 
-$project->account('sunnavy');
 $Mock_ua->mock( get            => sub { $Mock_response } );
 $Mock_ua->mock( default_header => sub { } );                  # to erase warning
 $Mock_response->mock(
diff --git a/t/06-user.t b/t/06-user.t
index 450426e..00b34f6 100644
--- a/t/06-user.t
+++ b/t/06-user.t
@@ -7,7 +7,7 @@ use Test::Mock::LWP;
 use_ok( 'Net::Lighthouse::User' );
 can_ok( 'Net::Lighthouse::User', 'new' );
 
-my $user = Net::Lighthouse::User->new;
+my $user = Net::Lighthouse::User->new( account => 'sunnavy' );
 isa_ok( $user, 'Net::Lighthouse::User' );
 isa_ok( $user, 'Net::Lighthouse' );
 
@@ -29,7 +29,6 @@ $Mock_response->mock(
     }
 );
 
-$user->account('sunnavy');
 my $sunnavy = $user->load( 67166 );
 is( $sunnavy, $user, 'load return $self' );
 for ( qw/name id job website avatar_url/ ) {

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



More information about the Bps-public-commit mailing list