Acme-CPANAuthors

 view release on metacpan or  search on metacpan

t/09_factory.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More 0.88;
use Test::Deep;
use Acme::CPANAuthors::Factory;

my $authors = Acme::CPANAuthors::Factory->create(
    Nonhuman => {
        ETHER => 'Karen Etheridge',
    },
    Japanese => {
        ISHIGAKI => 'Kenichi Ishigaki',
    },
);

is($authors->count, 2, 'author count');

is($authors->id, 2, 'author ids');

ok($authors->id('ISHIGAKI'), 'ISHIGAKI is a member');

my @names = $authors->name;
is(@names, 2, 'author names');

like($authors->name('ISHIGAKI'), qr/Ishigaki/i, 'Ishigaki is a member');

my @categories = $authors->categories;
is(@categories, 2, '2 categories');
cmp_deeply(
    \@categories,
    bag(qw(Nonhuman Japanese)),
    'categories',
);

done_testing;



( run in 0.923 second using v1.01-cache-2.11-cpan-5c0b1e786e0 )