API-Assembla

 view release on metacpan or  search on metacpan

t/spaces.t  view on Meta::CPAN

    plan skip_all => 'This test is useless unless you are the author';
}

use API::Assembla;

my $api = API::Assembla->new(
    username => 'iirobot',
    password => $ENV{'TEST_ASSEMBLA_PASS'}
);

my $data = $api->get_spaces;
cmp_ok(scalar(keys($data)), '==', 2, '2 spaces');
ok(exists($data->{PRG}), 'PRG space');

{
    my $space = $data->{PRG};
    cmp_ok($space->name, 'eq', 'PRG', 'space name');
    cmp_ok($space->id, 'eq', 'dhHT8ENtKr4k_1eJe4gwI3', 'space id');
    cmp_ok($space->created_at->ymd, 'eq', '2011-06-22', 'space created_at');
}

{
    my $space = $api->get_space('dhHT8ENtKr4k_1eJe4gwI3');
    cmp_ok($space->name, 'eq', 'PRG', 'space name');
    cmp_ok($space->id, 'eq', 'dhHT8ENtKr4k_1eJe4gwI3', 'space id');
    cmp_ok($space->created_at->ymd, 'eq', '2011-06-22', 'space created_at');



( run in 0.268 second using v1.01-cache-2.11-cpan-8d75d55dd25 )