Skip to content

Latest commit

 

History

History
136 lines (79 loc) · 2.86 KB

README.pod

File metadata and controls

136 lines (79 loc) · 2.86 KB

NAME

Test::Moose::More - More tools for testing Moose packages

VERSION

version 0.004

SYNOPSIS

use Test::Moose::More;

is_class 'Some::Class';
is_role  'Some::Role';
has_method_ok 'Some::Class', 'foo';

# ... etc

DESCRIPTION

This package contains a number of additional tests that can be employed against Moose classes/roles. It is intended to coexist with Test::Moose, though it does not (currently) require it.

FUNCTIONS

known_sugar

Returns a list of all the known standard Moose sugar (has, extends, etc).

TEST_FUNCTIONS

meta_ok $thing

Tests $thing to see if it has a metaclass; $thing may be the class name or instance of the class you wish to check.

does_ok $thing, < $role | \@roles >, [ $message ]

Checks to see if $thing does the given roles. $thing may be the class name or instance of the class you wish to check.

Note that the message will be taken verbatim unless it contains %s somewhere; this will be replaced with the name of the role being tested for.

has_method_ok $thing, @methods

Queries $thing's metaclass to see if $thing has the methods named in @methods.

is_role $thing

Passes if $thing's metaclass isa Moose::Meta::Role.

is_class $thing

Passes if $thing's metaclass isa Moose::Meta::Class.

check_sugar_removed_ok $thing

Ensures that all the standard Moose sugar is no longer directly callable on a given package.

check_sugar_ok $thing

Checks and makes sure a class/etc can still do all the standard Moose sugar.

validate_class

validate_class {

attributes => [ ... ],
methods    => [ ... ],
isa        => [ ... ],
does       => [ ... ],

requires_methods => [ ... ],

meta => {
    class => {
        ...as above
    },
    attribute ... etc
},
};

validate_role

The same as validate_class(), but for roles.

validate_thing

The same as validate_class() and validate_role(), except without the class or role validation.

SEE ALSO

Please see those modules/websites for more information related to this module.

SOURCE

The development version is on github at http://github.com/RsrchBoy/test-moose-more and may be cloned from git://github.com/RsrchBoy/test-moose-more.git

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/RsrchBoy/test-moose-more/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

Chris Weyl <cweyl@alumni.drew.edu>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2012 by Chris Weyl.

This is free software, licensed under:

The GNU Lesser General Public License, Version 2.1, February 1999