When testing in Perl I’ve come around to the idea of using
Test::Most in all my tests. At first I resisted because I like to minimize my dependencies to just what I need but a few realisations have turned me around in this case.
Test::Most automatically includes a bunch of the common test modules and the synopsis kind of makes it seem like that’s most of what it does but that’s under selling it. Those modules include useful functions like
dies_ok but it also sets up a bunch of useful defaults and adds some valuable features.
bail_on_fail is almost worth the price of admission itself. The fact that you can turn on the bail on fail with an environment variable (
BAIL_ON_FAIL) is seriously useful too.
explain function also deserves an honourable mention too. It’s basically a