]> git.vpit.fr Git - perl/modules/Acme-CPANAuthors-You-re_using.git/blob - t/10-base.t
c3899ce28c8983177902fd251aefa095e2037999
[perl/modules/Acme-CPANAuthors-You-re_using.git] / t / 10-base.t
1 #!perl
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 use Acme::CPANAuthors;
9
10 local @INC = grep $_ ne '.', @INC;
11
12 diag 'Directories in @INC :';
13 diag "  $_" for @INC;
14
15 my $authors = eval {
16  local $SIG{__WARN__} = sub {
17   my ($msg) = @_;
18   if ($msg =~ /^You're_using CPAN Authors are not registered yet: (.*)/s) {
19    die $1;
20   }
21   CORE::warn(@_);
22  };
23  Acme::CPANAuthors->new("You're_using");
24 };
25
26 if ($authors) {
27  plan tests => 5;
28 } else {
29  plan skip_all => $@;
30 }
31
32 my $count = $authors->count;
33 diag "$count authors found";
34 cmp_ok $count, '>', 0, 'there are some authors';
35
36 is   $authors->name('???'),      undef,         'wrong name';
37 is   $authors->name('VPIT'),     'Vincent Pit', 'we should at least have this module';
38 isnt $authors->name('ISHIGAKI'), undef,         'we should at least have Acme::CPANAuthors\' author';
39 isnt $authors->name('GAAS'),     undef,         'we should at least have LWP\'s author';