]> git.vpit.fr Git - perl/modules/Acme-CPANAuthors-You-re_using.git/blob - t/10-base.t
Remove '.' from @INC in the t/10-base.t test
[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 my $authors = eval {
13  local $SIG{__WARN__} = sub {
14   my ($msg) = @_;
15   if ($msg =~ /^You're_using CPAN Authors are not registered yet: (.*)/s) {
16    die $1;
17   }
18   CORE::warn(@_);
19  };
20  Acme::CPANAuthors->new("You're_using");
21 };
22
23 if ($authors) {
24  plan tests => 5;
25 } else {
26  plan skip_all => $@;
27 }
28
29 diag 'Directories in @INC :';
30 diag "  $_" for @INC;
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';