NAME

SmokeRunner::Multi::Validate - Wrapper around Params::Validate for SmokeRunner::Multi

VERSION

version 0.21

SYNOPSIS

use SmokeRunner::Multi::Validate qw( validate DIR_TYPE TEST_SET_TYPE );

my $spec = {
    dir => DIR_TYPE,
    set => TEST_SET_TYPE( optional => 1 ),
};
sub foo {
    my %p = validate( @_, $spec );

    ...
}

DESCRIPTION

This module provides a wrapper around Params::Validate. It basically consists of type-generating subroutines which can be used to easily create a validation spec for Params::Validate::validate().

EXPORTS

This module optionally exports all of the exported constants and subroutines provided by Params::Validate. In addition, it offers a number of higher-level type-generating subroutines. Most of these are wrappers around the Params::Validate types.

SCALAR_TYPE, ARRAYREF_TYPE, HASHREF_TYPE, BOOLEAN_TYPE, UNDEF_TYPE, CODEREF_TYPE, GLOBREF_TYPE, GLOB_TYPE, HANDLE_TYPE, OBJECT_TYPE, SCALARREF_TYPE

These are all wrappers around the standard type parameters provided by Params::Validate.

DIR_TYPE

This is a scalar which must be a valid directory path.

TEST_SET_TYPE

This is an object of the SmokeRunner::Multi::TestSet class.

RUNNER_TYPE

This is an object of the SmokeRunner::Multi::Runner class.

Type Generator Usage

When you want to use one of the types exported by this module, you use it as the entire definition for a named or position parameter. If you want to further qualify the type with a default, pass this as a parameter to the type generator subroutine:

my $spec = {
    size => SCALAR_TYPE( default => 5 ),
};

SEE ALSO

See the other classes in this distribution for more information: SmokeRunner::Multi::TestSet, SmokeRunner::Multi::Runner, SmokeRunner::Multi::Reporter, and SmokeRunner::Multi::Config.

AUTHOR

Dave Rolsky, <autarch@urth.org>

BUGS

Please report any bugs or feature requests to bug-smokerunner-multi@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2007 LiveText, Inc., All Rights Reserved.

This program is free software; you can redistribute it and /or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

AUTHORS

  • Dave Rolsky <autarch@urth.org>

  • Yanick Champoux <yanick@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2007 by LiveText, Inc..

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.