VERSION
Version 0.34
DESCRIPTION
Groups methods by their purity level for more efficient test file organisation. Pure methods can share setup; mutating methods need per-test objects; impure methods need full isolation blocks.
new
Construct a new Grouping planner.
my $planner = App::Test::Generator::Planner::Grouping->new;
Arguments
None.
Returns
A blessed hashref.
API specification
input
{}
output
{
type => OBJECT,
isa => 'App::Test::Generator::Planner::Grouping',
}
plan
Group all methods in the schema by their purity level.
my $planner = App::Test::Generator::Planner::Grouping->new;
my $groups = $planner->plan($schema);
printf "Pure methods: %s\n", join(', ', @{ $groups->{pure} });
printf "Mutating methods:%s\n", join(', ', @{ $groups->{mutating} });
printf "Impure methods: %s\n", join(', ', @{ $groups->{impure} });
Arguments
$schemaA hashref of method schemas each optionally containing a
_analysiskey with aside_effectssub-key as produced by App::Test::Generator::Analyzer::SideEffect.
Returns
A hashref with three keys — pure, mutating, and impure — each containing an arrayref of method names assigned to that group. Methods without purity metadata are placed in impure by default.
Note: the purity level self_mutating from App::Test::Generator::Analyzer::SideEffect is mapped to the mutating group key in this output.
API specification
input
{
self => { type => OBJECT, isa => 'App::Test::Generator::Planner::Grouping' },
schema => { type => HASHREF },
}
output
{
type => HASHREF,
keys => {
pure => { type => ARRAYREF },
mutating => { type => ARRAYREF },
impure => { type => ARRAYREF },
},
}
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 94:
Non-ASCII character seen before =encoding in '—'. Assuming UTF-8