X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F10-base.t;h=f9a80a7c85c985b1f114a148fbb851b24fd2946d;hb=82cde04d830d067d6b3e49ae5f0028b5b82d6850;hp=60a54bc8eb1326f29483fe6cb642dd7a037bbc63;hpb=ccce87545fda1846090f652fc4770e2393070ab9;p=perl%2Fmodules%2FAcme-CPANAuthors-You-re_using.git diff --git a/t/10-base.t b/t/10-base.t index 60a54bc..f9a80a7 100644 --- a/t/10-base.t +++ b/t/10-base.t @@ -3,16 +3,35 @@ use strict; use warnings; -use Test::More tests => 1; +use Test::More; use Acme::CPANAuthors; -my $authors = eval { Acme::CPANAuthors->new("You're_using") }; +my $authors = eval { + local $SIG{__WARN__} = sub { + my ($msg) = @_; + if ($msg =~ /^You're_using CPAN Authors are not registered yet: (.*)/s) { + die $1; + } + CORE::warn(@_); + }; + Acme::CPANAuthors->new("You're_using"); +}; -SKIP: { - skip $@ => 1 unless defined $authors; - - my $count = $authors->count; - diag "$count authors found"; - cmp_ok $count, '>', 0, 'there are some authors'; +if ($authors) { + plan tests => 5; +} else { + plan skip_all => $@; } + +diag 'Directories in @INC :'; +diag " $_" for @INC; + +my $count = $authors->count; +diag "$count authors found"; +cmp_ok $count, '>', 0, 'there are some authors'; + +is $authors->name('???'), undef, 'wrong name'; +is $authors->name('VPIT'), 'Vincent Pit', 'we should at least have this module'; +isnt $authors->name('ISHIGAKI'), undef, 'we should at least have Acme::CPANAuthors\' author'; +isnt $authors->name('GAAS'), undef, 'we should at least have LWP\'s author';