On 2012-05-26T00:03:57+01:00, DOHERTY wrote:
Show quoted text> Sometimes, you need to specify an import list or otherwise pass arguments
> to the module's import method. Currently, there seems to be no way to do
> that.
Personally I just do it this way:
use Test::Requires "List::MoreUtils";
use Test::More;
use List::MoreUtils qw(none);
ok(
none { $_ > 10 } qw( 1 2 3 );
);
done_testing;
That is, after checking that the required module List::MoreUtils is installed, I explicitly load it.
After all, it is not a documented feature that Test::Requires will load List::MoreUtils. Test::Requires just tests to see if the module *can* be loaded.
(Of course, to test this, it does load it, but that's a detail of the current implementation, and could theoretically change.)