View on
MetaCPAN
search.cpan.org is shutting down
For details read Perl NOC. After June 25th this page will redirect to MetaCPAN.org
Dave Rolsky > Test-Class-Moose > Test::Class::Moose::Role::CLI

Download:
Test-Class-Moose-0.92.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.92   Source  

NAME ^

Test::Class::Moose::Role::CLI - Role for command line argument handling and extra CLI features

VERSION ^

version 0.92

SYNOPSIS ^

    package My::CLI;

    use Moose;

    with 'Test::Class::Moose::Role::CLI';

    sub _munge_class {
        return $_[1] =~ /^TestFor::/ ? $_[1] : 'TestFor::MyApp::' . $_[1] );
    }

    sub _before_run { ... }
    sub _after_run { ... }

DESCRIPTION ^

This role provides the core implementation of command line option processing for Test::Class::Moose::CLI. You can consume this role and add additional hooks to customize how your test classes are run.

See Test::Class::Moose::CLI for a list of all the available command line options that this role handles.

HOOKS ^

This role has several hook methods that it calls. The role provides no-op or default implementations of these hooks but you can provide an implementation in your class that does something.

_munge_class

This method is called for each class passed on the command line with the --classes option. It passed the command line argument (one per call). You can use this to allow people to pass short names like Model::Car and turn it into a full name like TestFor::MyApp::Model::Car.

By default this method is a no-op.

_before_run

This method is called before the test classes are run (or even loaded).

By default this method is a no-op.

_test_lib_dirs

This should return a list of directories containing test classes. The directories can be relative to the project root (t/lib) or absolute.

This defaults to returning a single path, t/lib.

_load_classes

This method will try to load all the classes passed on the command line if any were passed. If the value that was passed is a path rather than a class name, any leading part matching a value in the list from _test_lib_dirs will be stripped, and the rest will be transformed from a path to a module name.

Otherwise it invokes Test::Class::Moose::Load with the value returned by _test_lib_dirs as its argument.

_after_run

This method is called after all the test classes are run.

By default this method is a no-op.

SUPPORT ^

Bugs may be submitted at https://github.com/houseabsolute/test-class-moose/issues.

I am also usually active on IRC as 'autarch' on irc://irc.perl.org.

SOURCE ^

The source code repository for Test-Class-Moose can be found at https://github.com/houseabsolute/test-class-moose.

AUTHORS ^

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2012 - 2017 by Curtis "Ovid" Poe.

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

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

syntax highlighting: