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 eq_or_diff and dies_ok but it also sets up a bunch of useful defaults and adds some valuable features.

The 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.

The explain function also deserves an honourable mention too.  It’s basically a note Dumper($var).


One thought on “Test::Most

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s