From: Vincent Pit Date: Tue, 17 Feb 2009 16:41:39 +0000 (+0100) Subject: t/10-base.t overhaul X-Git-Tag: v0.02~3 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=fff2b130bbe5c6293252b43d93535419e682e7bf;p=perl%2Fmodules%2FAcme-CPANAuthors-You-re_using.git t/10-base.t overhaul --- diff --git a/t/10-base.t b/t/10-base.t index 60a54bc..01ca3ac 100644 --- a/t/10-base.t +++ b/t/10-base.t @@ -3,16 +3,26 @@ 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 { die @_ }; + 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 => $@; } + +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('LBROCARD'), undef, 'we should at least have Parse::CPAN::* author';