|
NAMETest::Able::Runner - use Test::Able without a bunch of boilerplateVERSIONversion 1.002SYNOPSISuse Test::Able::Runner; use_test_packages -base_package => 'My::Project::Test'; run; DESCRIPTIONI like Test::Able. I really don't like having to copy my boilerplate test runner and modify it when I use it in a new project. This provides a basic test runner for your testable tests that takes care of the basics for you. You can extend it a bit to customize things if you like as well. Let me know if you want this to do something else.This mostly assumes that you want to run several tests as a group within a single Perl interpreter. If this is not what you want, then you probably don't want this module. METHODSuse_test_packagesThe first thing your test runner needs to do is call this method to tell it what packages need to be included in your test.COMMON CASESBefore describing the options, here are some examples of how to use this subroutine.EXAMPLE 1 use_test_packages -base_package => 'My::Project::Test', -test_path => 't/lib'; This is pretty much the simplest case. This will load and run all the packages starting with the name "My::Project::Test" found in the project's t/lib directory. I show the "-test_path" option here, but in this case it's redundant. Your test path is assumed to be t/lib in the usual case. EXAMPLE 2 use_test_packages -test_packages => [ qw( My::Project::Test::One My::Project::Test::Two My::Project::Test::Three ) ]; Rather than searching for any test packages you might have in your test folder, you might prefer to explicitly list them. OPTIONS
init_metaSets up your test runner package.runThis invokes the test runner for all the tests you've requested.COOKBOOKHere are some other things you might like to try.Test Runner TestsThe test runner itself may have tests if you want. The test runner classes uses the usual Test::Able bits, so this works. Similarly, you can do setup, teardown, and all the rest in your runner.use Test::Able::Runner; use_test_packages -base_package => 'Foo::Test'; test plan => 1, test_something => sub { ok(1); }; run; AUTHORAndrew Sterling Hanenkamp "<hanenkamp@cpan.org>"COPYRIGHT AND LICENSECopyright 2010 Qubling Software LLC.This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |