NAME

Test::Class::Moose::Config - Configuration information for Test::Class::Moose

VERSION

version 0.99

SYNOPSIS

my $tc_config = Test::Class::Moose::Config->new({
    show_timing => 1,
    statistics  => 1,
    randomize   => 0,
});
my $test_suite = Test::Class::Moose->new($tc_config);

DESCRIPTION

For internal use only (maybe I'll expose it later). Not guaranteed to be stable.

This class defines many of the attributes for Test::Class::Moose. They're kept here to minimize namespace pollution in Test::Class::Moose.

ATTRIBUTES

show_timing

Boolean. Will display verbose information on the amount of time it takes each test class/test method to run.

statistics

Boolean. Will display number of classes, test methods and tests run.

use_environment

Boolean. Sets show_timing and statistics to true if your test harness is running verbosely, false otherwise.

test_classes

Takes a class name or an array reference of class names. If it is present, the test_classes method will only return these classes. This is very useful if you wish to run an individual class as a test:

Test::Class::Moose->new(
    test_classes => $ENV{TEST_CLASS}, # ignored if undef
)->runtests;

include_tags

Array ref of strings matching method tags (a single string is also ok). If present, only test methods whose tags match include_tags or whose tags don't match exclude_tags will be included. However, they must still start with test_.

For example:

my $test_suite = Test::Class::Moose->new({
    include_tags => [qw/api database/],
});

The above constructor will only run tests tagged with api or database.

exclude_tags

The same as include_tags, but will exclude the tests rather than include them. For example, if your network is down:

my $test_suite = Test::Class::Moose->new({
    exclude_tags => [ 'network' ],
});

# or
my $test_suite = Test::Class::Moose->new({
    exclude_tags => 'network',
});

randomize

Boolean. Will run test methods of a class in a random order.

randomize_classes

Boolean. Will run test classes in a random order.

METHODS

args

Returns a hash of the args used to build the configuration. This used to be used internally, but is now retained simply for backwards compatibility. You probably won't need it.

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

  • Curtis "Ovid" Poe <ovid@cpan.org>

  • Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 - 2021 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.