Skip to content

Instantly share code, notes, and snippets.

@belden
Last active August 29, 2015 14:22
Show Gist options
  • Save belden/c8c4855be3ed9bbabb41 to your computer and use it in GitHub Desktop.
Save belden/c8c4855be3ed9bbabb41 to your computer and use it in GitHub Desktop.
thoughts on testing

A few thoughts on testing:

  • If you're used to PHPunit, then you might find Test::Class to be analogous.
  • However, if you're not going to use the different features of Test::Class (namely: being able to subclass your test classes), then you'll probably get a lot of mileage out of just using Test::More or Test::Most.

Here's a quick rundown of the features that I see these three providing.

module ships with perl ease of use like phpunit
Test::More yes high no
Test::Most no high no
Test::Class no medium yes

What's helpful to know is that Test::Class provides a framework for structuring your tests in a JUnit-style fashion. Within your test classes, your individual testing-level assertions will be built up from functions provided by Test::More, Test::Most, and ilk.

If you can install new Perl libraries on your system, then I'd recommend getting started with Test::Most. It's a convenient wrapper to export testing functions provided by Test::More, Test::Exception, and others. But if you really, really just want to get started, then just pick Test::More.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment