X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FAcme-CPANAuthors-You-re_using.git;a=blobdiff_plain;f=t%2F11-naughty-version.t;fp=t%2F11-naughty-version.t;h=1cf4385a7ce1721e62ea861bb054ec54e900e7a2;hp=0000000000000000000000000000000000000000;hb=a5f2d9b989d2afcdb4a7b0cc374439627a516656;hpb=e6c1024084a55bcef215da9be5b6410710be545f diff --git a/t/11-naughty-version.t b/t/11-naughty-version.t new file mode 100644 index 0000000..1cf4385 --- /dev/null +++ b/t/11-naughty-version.t @@ -0,0 +1,31 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More tests => 2; + +use lib 't/lib'; + +use Acme::CPANAuthors; + +local @INC = grep $_ ne '.', @INC; + +our $test_loaded; +local $test_loaded = 0; + +my $err = do { + local $SIG{__WARN__} = sub { + my $msg = join "\n", @_; + if ($msg =~ /cabbage/) { + die "$msg\n"; + } else { + diag $msg; + } + }; + eval { Acme::CPANAuthors->new("You're_using") }; + $@; +}; + +is $test_loaded, 1, 'naughty module was actually loaded'; +is $err, '', 'naughty module did not make us croak';