TB2::OnlyOnePlan - Enforces there being only one plan per test
# Add an instance of this to the TestState to enforce plans use TB2::OnlyOnePlan; $test_state->add_early_handlers( TB2::OnlyOnePlan->new );
This is a TB2::EventHandler which enforces there being only one plan issued per test.
There are exceptions...
Subtests must have their own plan, so that is allowed.
There's no harm in setting "no_plan" multiple times. This specifically allows...
use Test::More "no_plan"; ...test test test... done_testing();
There is no harm in raising the specificity of the plan. This specifically allows...
use Test::More "no_plan"; ...test test test... done_testing(5);
This specificially allows redundant planning...
use Test::More tests => 3; pass("One"); pass("Two"); pass("Three"); done_testing(3);
To install Test::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Simple
CPAN shell
perl -MCPAN -e shell install Test::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.