I am impressed that this module is not installed
You should add it as a dependency to your Makefile.PL, as you should with all your dependencies (see ExtUtils::MakeMaker):
use ExtUtils::MakeMaker 6.64; WriteMakefile( ... PREREQ_PM => { # your module's runtime dependencies }, TEST_REQUIRES => { 'Test::Exception' => 0, }, );
I assumed that by default this is a core module and it would be installed by default but I guess I was wrong.
It is not a core module, as you can check with corelist:
$ corelist "/Test::Exception/" /Test::Exception/ has no match in CORE (or so I think)
Does any one know any other way of testing croak?
Personally I use Test::Fatal, but I think Test::Exception is a good choice too.
use Test::More; use Test::Fatal 'exception'; like exception { die "Blam"; }, qr/\bBlam\b/, 'exception is as expected';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Error: Can't locate Test/Exception.pm in @INC (you may need to install the Test::Exception module) on CPANPLUS
by thanos1983 (Parson) on Sep 27, 2017 at 09:20 UTC | |
by haukex (Archbishop) on Sep 27, 2017 at 10:25 UTC | |
by haukex (Archbishop) on Oct 02, 2017 at 09:49 UTC |