Blitz
view release on metacpan or search on metacpan
lib/Blitz/Validate.pm view on Meta::CPAN
# url
if (!$options->{url}) {
push @$reasons, "No URL given";
}
elsif (! _is_url($options->{url}) ) {
push @$reasons, "Invalid URL: $options->{url}";
}
# pattern
if ($options->{pattern} && $test_type eq 'rush') {
if (!$options->{pattern}{iterations} || ! _is_integer($options->{pattern}{iterations}) ) {
push @$reasons, "Pattern iterations not given or not an integer";
}
else {
$options->{pattern}{iterations} += 0;
}
if (! $options->{pattern}{intervals} || ! _is_array($options->{pattern}{intervals}) ) {
push @$reasons, "Intervals is not an array";
}
}
elsif ($options->{pattern} && $test_type eq 'sprint') {
push @$reasons, 'Pattern is not a valid options for sprints';
}
# region
( run in 0.818 second using v1.01-cache-2.11-cpan-71847e10f99 )