Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

More tools for testing Moose packages

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.pod

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

This document describes version 0.013 of Test::Moose::More - released September 30, 2012 as part of Test-Moose-More.

    use Test::Moose::More;

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

    # ... etc

This package contains a number of additional tests that can be employed against Moose classes/roles. It is intended to replace Test::Moose in your tests, and reexports any tests that it has and we do not, yet.

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

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

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.

Checks to see if $thing does not do 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.

Checks $thing for an attribute named $attribute_name; $thing may be a class name, instance, or role name.

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

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

Note that this really only makes sense if $thing is a role.

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

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

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

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

Runs a bunch of tests against the given $thing, as defined:

    validate_class $thing => (

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

        # ensures $thing does these roles
        does       => [ ... ],

        # ensures $thing does not do these roles
        does_not   => [ ... ],
    );

$thing can be the name of a role or class, an object instance, or a metaclass.

The same as validate_thing(), but ensures $thing is a role, and allows for additional role-specific tests.

    validate_role $thing => (

        required_methods => [ ... ],

        # ...and all other options from validate_thing()

The same as validate_thing(), but ensures $thing is a class, and allows for additional class-specific tests.

Run checks against an attribute.

Not yet documented or tested exhaustively.

Validates that an attribute is set up as expected.

Not yet documented or tested exhaustively.

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

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

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.

Chris Weyl <cweyl@alumni.drew.edu>

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
Something went wrong with that request. Please try again.