Test :: More provides a commonly used test use_okto verify module loading. But how can I verify that the module is not loading? Test :: Exception also offers dies_okcousins for similar crashes, but not during use.
This is useful when a module requires certain parameters or a specific environment to load correctly, and I want to check these conditions. As an example, perhaps my “Foo” module requires a configuration parameter, and otherwise it should not load:
use Foo 'eat my hat';
use Foo;
I can easily check the first case with Test :: More:
BEGIN { use_ok('Foo','eat my hat') }
But how can I check something else?
BEGIN { use_not_ok('Foo') }