]> git.vpit.fr Git - perl/modules/Acme-CPANAuthors-You-re_using.git/blob - t/11-naughty-version.t
Guard against exceptions thrown by Module::Metadata
[perl/modules/Acme-CPANAuthors-You-re_using.git] / t / 11-naughty-version.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 2;
7
8 use lib 't/lib';
9
10 use Acme::CPANAuthors;
11
12 local @INC = grep $_ ne '.', @INC;
13
14 our $test_loaded;
15 local $test_loaded = 0;
16
17 my $err = do {
18  local $SIG{__WARN__} = sub {
19   my $msg = join "\n", @_;
20   if ($msg =~ /cabbage/) {
21    die "$msg\n";
22   } else {
23    diag $msg;
24   }
25  };
26  eval { Acme::CPANAuthors->new("You're_using") };
27  $@;
28 };
29
30 is $test_loaded, 1,  'naughty module was actually loaded';
31 is $err,         '', 'naughty module did not make us croak';