{"id":20482960,"url":"https://github.com/rsrchboy/test-moose-more","last_synced_at":"2025-04-13T14:34:19.655Z","repository":{"id":2273976,"uuid":"3230734","full_name":"rsrchboy/Test-Moose-More","owner":"rsrchboy","description":"More tools for testing Moose packages","archived":false,"fork":false,"pushed_at":"2024-04-25T13:49:38.000Z","size":659,"stargazers_count":3,"open_issues_count":9,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T05:34:19.906Z","etag":null,"topics":["moose","perl","perl5","testing"],"latest_commit_sha":null,"homepage":"http://metacpan.org/release/Test-Moose-More/","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsrchboy.png","metadata":{"files":{"readme":"README.mkdn","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-01-20T23:14:13.000Z","updated_at":"2018-10-05T03:15:26.000Z","dependencies_parsed_at":"2025-04-13T14:33:46.128Z","dependency_job_id":null,"html_url":"https://github.com/rsrchboy/Test-Moose-More","commit_stats":null,"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsrchboy%2FTest-Moose-More","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsrchboy%2FTest-Moose-More/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsrchboy%2FTest-Moose-More/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsrchboy%2FTest-Moose-More/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsrchboy","download_url":"https://codeload.github.com/rsrchboy/Test-Moose-More/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248728691,"owners_count":21152276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["moose","perl","perl5","testing"],"created_at":"2024-11-15T16:15:21.790Z","updated_at":"2025-04-13T14:34:19.637Z","avatar_url":"https://github.com/rsrchboy.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/RsrchBoy/Test-Moose-More.svg?branch=master)](https://travis-ci.org/RsrchBoy/Test-Moose-More)\n[![Kwalitee status](http://cpants.cpanauthors.org/dist/Test-Moose-More.png)](http://cpants.charsbar.org/dist/overview/Test-Moose-More)\n[![Coverage Status](https://coveralls.io/repos/RsrchBoy/Test-Moose-More/badge.svg?branch=master)](https://coveralls.io/r/RsrchBoy/Test-Moose-More?branch=master)\n\n# NAME\n\nTest::Moose::More - More tools for testing Moose packages\n\n# VERSION\n\nThis document describes version 0.050 of Test::Moose::More - released September 20, 2017 as part of Test-Moose-More.\n\n# SYNOPSIS\n\n    use Test::Moose::More;\n\n    is_class_ok 'Some::Class';\n    is_role_ok  'Some::Role';\n    has_method_ok 'Some::Class', 'foo';\n\n    # ... etc\n\n# DESCRIPTION\n\nThis package contains a number of additional tests that can be employed\nagainst Moose classes/roles.  It is intended to replace [Test::Moose](https://metacpan.org/pod/Test::Moose) in your\ntests, and re-exports any tests that it has and we do not, yet.\n\n## Export Groups\n\nBy default, this package exports all test functions.  You can be more\nselective, however, and there are a number of export groups (aside from the\ndefault `:all`) to help you achieve those dreams!\n\n- :all\n\n    All exportable functions.\n\n- :validate\n\n    [\"validate\\_attribute\"](#validate_attribute), [\"validate\\_class\"](#validate_class), [\"validate\\_role\"](#validate_role), [\"validate\\_thing\"](#validate_thing)\n\n# TEST FUNCTIONS\n\n## meta\\_ok $thing\n\nTests `$thing` to see if it has a metaclass; `$thing` may be the class name or\ninstance of the class you wish to check.  Passes if `$thing` has a metaclass.\n\n## no\\_meta\\_ok $thing\n\nTests `$thing` to see if it does not have a metaclass; `$thing` may be the class\nname or instance of the class you wish to check.  Passes if `$thing` does not\nhave a metaclass.\n\n## does\\_ok $thing, \u003c $role | \\\\@roles \u003e, \\[ $message \\]\n\nChecks to see if `$thing` does the given roles.  `$thing` may be the class name or\ninstance of the class you wish to check.\n\nNote that the message will be taken verbatim unless it contains `%s`\nsomewhere; this will be replaced with the name of the role being tested for.\n\n## does\\_not\\_ok $thing, \u003c $role | \\\\@roles \u003e, \\[ $message \\]\n\nChecks to see if `$thing` does not do the given roles.  `$thing` may be the\nclass name or instance of the class you wish to check.\n\nNote that the message will be taken verbatim unless it contains `%s`\nsomewhere; this will be replaced with the name of the role being tested for.\n\n## has\\_attribute\\_ok $thing, $attribute\\_name, \\[ $message \\]\n\nChecks `$thing` for an attribute named `$attribute_name`; `$thing` may be a\nclass name, instance, or role name.\n\n## has\\_method\\_ok $thing, @methods\n\nQueries `$thing`'s metaclass to see if `$thing` has the methods named in\n`@methods`.\n\nNote: This does **not** include inherited methods; see\n[\"has\\_method\" in Class::MOP::Class](https://metacpan.org/pod/Class::MOP::Class#has_method).\n\n## has\\_no\\_method\\_ok $thing, @methods\n\nQueries `$thing`'s metaclass to ensure `$thing` does not provide the methods named\nin `@methods`.\n\nNote: This does **not** include inherited methods; see\n[\"has\\_method\" in Class::MOP::Class](https://metacpan.org/pod/Class::MOP::Class#has_method).\n\n## has\\_method\\_from\\_anywhere\\_ok $thing, @methods\n\nQueries `$thing`'s metaclass to see if `$thing` has the methods named in\n`@methods`.\n\nNote: This **does** include inherited methods; see\n[\"find\\_method\\_by\\_name\" in Class::MOP::Class](https://metacpan.org/pod/Class::MOP::Class#find_method_by_name).\n\n## has\\_no\\_method\\_from\\_anywhere\\_ok $thing, @methods\n\nQueries `$thing`'s metaclass to ensure `$thing` does not provide the methods\nnamed in `@methods`.\n\nNote: This **does** include inherited methods; see\n[\"find\\_method\\_by\\_name\" in Class::MOP::Class](https://metacpan.org/pod/Class::MOP::Class#find_method_by_name).\n\n## method\\_from\\_pkg\\_ok $thing, $method, $orig\\_pkg\n\nGiven a thing (role, class, etc) and a method, test that it originally came\nfrom `$orig_pkg`.\n\n## method\\_not\\_from\\_pkg\\_ok $thing, $method, $orig\\_pkg\n\nGiven a thing (role, class, etc) and a method, test that it did not come from\n`$orig_pkg`.\n\n## method\\_is\\_accessor\\_ok $thing, $method\n\nGiven a thing (role, class, etc) and a method, test that the method is an\naccessor -- that is, it descends from [Class::MOP::Method::Accessor](https://metacpan.org/pod/Class::MOP::Method::Accessor).\n\n## method\\_is\\_not\\_accessor\\_ok $thing, $method\n\nGiven a thing (role, class, etc) and a method, test that the method is **not**\nan accessor -- that is, it does not descend from [Class::MOP::Method::Accessor](https://metacpan.org/pod/Class::MOP::Method::Accessor).\n\n## definition\\_context\\_ok $meta, \\\\%dc\n\nValidates the definition context of a metaclass instance.  This is a strict\ncomparison.\n\n## role\\_wraps\\_around\\_method\\_ok $role, @methods\n\nQueries `$role`'s metaclass to see if `$role` wraps the methods named in\n`@methods` with an around method modifier.\n\n## role\\_wraps\\_before\\_method\\_ok $role, @methods\n\nQueries `$role`'s metaclass to see if `$role` wraps the methods named in\n`@methods` with an before method modifier.\n\n## role\\_wraps\\_after\\_method\\_ok $role, @methods\n\nQueries `$role`'s metaclass to see if `$role` wraps the methods named in\n`@methods` with an after method modifier.\n\n## requires\\_method\\_ok $thing, @methods\n\nQueries `$thing`'s metaclass to see if `$thing` requires the methods named in\n`@methods`.\n\nNote that this really only makes sense if `$thing` is a role.\n\n## does\\_not\\_require\\_method\\_ok $thing, @methods\n\nQueries `$thing`'s metaclass to ensure `$thing` does not require the methods named\nin `@methods`.\n\nNote that this really only makes sense if `$thing` is a role.\n\n## is\\_immutable\\_ok $thing\n\nPasses if `$thing` is immutable.\n\n## is\\_not\\_immutable\\_ok $thing\n\nPasses if `$thing` is not immutable; that is, is mutable.\n\n## is\\_pristine\\_ok $thing\n\nPasses if `$thing` is pristine.  See [\"is\\_pristine\" in Class::MOP::Class](https://metacpan.org/pod/Class::MOP::Class#is_pristine).\n\n## is\\_not\\_pristine\\_ok $thing\n\nPasses if `$thing` is not pristine.  See [\"is\\_pristine\" in Class::MOP::Class](https://metacpan.org/pod/Class::MOP::Class#is_pristine).\n\n## is\\_role\\_ok $thing\n\nPasses if `` `$thing`'s `` metaclass is a [Moose::Meta::Role](https://metacpan.org/pod/Moose::Meta::Role).\n\n## is\\_class\\_ok $thing\n\nPasses if `` `$thing`'s `` metaclass is a [Moose::Meta::Class](https://metacpan.org/pod/Moose::Meta::Class).\n\n## is\\_anon\\_ok $thing\n\nPasses if `$thing` is \"anonymous\".\n\n## is\\_not\\_anon\\_ok $thing\n\nPasses if `$thing` is not \"anonymous\".\n\n## check\\_sugar\\_removed\\_ok $thing\n\nEnsures that all the standard Moose sugar is no longer directly callable on a\ngiven package.\n\n## check\\_sugar\\_ok $thing\n\nChecks and makes sure a class/etc can still do all the standard Moose sugar.\n\n## does\\_metaroles\\_ok $thing =\u003e { $mop =\u003e \\[ @traits \\], ... };\n\nValidate the metaclasses associated with a class/role metaclass.\n\ne.g., if I wanted to validate that the attribute trait for\n[MooseX::AttributeShortcuts](https://metacpan.org/pod/MooseX::AttributeShortcuts) is actually applied, I could do this:\n\n    { package TestClass; use Moose; use MooseX::AttributeShortcuts; }\n    use Test::Moose::More;\n    use Test::More;\n\n    does_metaroles_ok TestClass =\u003e {\n       attribute =\u003e ['MooseX::AttributeShortcuts::Trait::Attribute'],\n    };\n    done_testing;\n\nThis function will accept either class or role metaclasses for `$thing`.\n\nThe MOPs available for classes ([Moose::Meta::Class](https://metacpan.org/pod/Moose::Meta::Class)) are:\n\n- class\n- attribute\n- method\n- wrapped\\_method\n- instance\n- constructor\n- destructor\n\nThe MOPs available for roles ([Moose::Meta::Role](https://metacpan.org/pod/Moose::Meta::Role)) are:\n\n- role\n- attribute\n- method\n- required\\_method\n- wrapped\\_method\n- conflicting\\_method\n- application\\_to\\_class\n- application\\_to\\_role\n- application\\_to\\_instance\n- applied\\_attribute\n\nNote!  Neither this function nor `does_not_metaroles_ok()` attempts to\nvalidate that the MOP type passed in is a member of the above lists.  There's\nno gain here in implementing such a check, and a negative to be had:\nspecifying an invalid MOP type will result in immediate explosions, while it's\nentirely possible other MOP types will be added (either to core, via traits,\nor \"let's subclass Moose::Meta::Class/etc and implement something new\").\n\n## does\\_not\\_metaroles\\_ok $thing =\u003e { $mop =\u003e \\[ @traits \\], ... };\n\nAs with [\"does\\_metaroles\\_ok\"](#does_metaroles_ok), but test that the metaroles are not consumed, a\nla [\"does\\_not\\_ok\"](#does_not_ok).\n\n## attribute\\_options\\_ok\n\nValidates that an attribute is set up as expected; like\n`validate_attribute()`, but only concerns itself with attribute options.\n\nNote that some of these options will skip if used against attributes defined\nin a role.\n\n- `-subtest =\u003e 'subtest name...'`\n\n    If set, all tests run (save the first, \"does this thing even have this\n    attribute?\" test) will be wrapped in a subtest, the name of which will be\n    whatever `-subtest` is set to.\n\n- `is =\u003e ro|rw`\n\n    Tests for reader/writer options set as one would expect.\n\n- `isa =\u003e ...`\n\n    Validates that the attribute requires its value to be a given type.\n\n- `does =\u003e ...`\n\n    Validates that the attribute requires its value to do a given role.\n\n- `builder =\u003e '...'`\n\n    Validates that the attribute expects the method name given to be its builder.\n\n- `default =\u003e ...`\n\n    Validates that the attribute has the given default.\n\n- `init_arg =\u003e '...'`\n\n    Validates that the attribute has the given initial argument name.\n\n- `lazy =\u003e 0|1`\n\n    Validates that the attribute is/isn't lazy.\n\n- `required =\u003e 0|1`\n\n    Validates that setting the attribute's value is/isn't required.\n\n# VALIDATION METHODS\n\n## validate\\_thing\n\nRuns a bunch of tests against the given `$thing`, as defined:\n\n    validate_thing $thing =\u003e (\n\n        attributes =\u003e [ ... ],\n        methods    =\u003e [ ... ],\n        isa        =\u003e [ ... ],\n\n        # ensures sugar is/is-not present\n        sugar      =\u003e 0,\n\n        # ensures $thing does these roles\n        does       =\u003e [ ... ],\n\n        # ensures $thing does not do these roles\n        does_not   =\u003e [ ... ],\n    );\n\n`$thing` can be the name of a role or class, an object instance, or a\nmetaclass.\n\n- `-subtest =\u003e 'subtest name...'`\n\n    If set, all tests run will be wrapped in a subtest, the name of which will be\n    whatever `-subtest` is set to.\n\n- `isa =\u003e [ ... ]`\n\n    A list of superclasses thing should have.\n\n- `anonymous =\u003e 0|1`\n\n    Check to see if the class is/isn't anonymous.\n\n- `does =\u003e [ ... ]`\n\n    A list of roles the thing should do.\n\n- `does_not =\u003e [ ... ]`\n\n    A list of roles the thing should not do.\n\n- `attributes =\u003e [ ... ]`\n\n    The attributes list specified here is in the form of a list of names, each\n    optionally followed by a hashref of options to test the attribute for; this\n    hashref takes the same arguments [\"validate\\_attribute\"](#validate_attribute) does.  e.g.:\n\n        validate_thing $thing =\u003e (\n\n            attributes =\u003e [\n                'foo',\n                'bar',\n                baz =\u003e { is =\u003e 'ro', ... },\n                'bip',\n            ],\n        );\n\n- `methods =\u003e [ ... ]`\n\n    A list of methods the thing should have; see [\"has\\_method\\_ok\"](#has_method_ok).\n\n- `no_methods =\u003e [ ... ]`\n\n    A list of methods the thing should not have; see [\"has\\_no\\_method\\_ok\"](#has_no_method_ok).\n\n- `sugar =\u003e 0|1`\n\n    Ensure that thing can/cannot do the standard Moose sugar.\n\n- `metaclasses =\u003e { $mop =\u003e { ... }, ... }`\n\n    Validates this thing's metaclasses: that is, given a MOP type (e.g. class,\n    attribute, method, ...) and a hashref, find the associated metaclass of the\n    given type and invoke [\"validate\\_thing\"](#validate_thing) on it, using the hashref as options\n    for `validate_thing()`.\n\n    e.g.\n\n        validate_thing 'TestClass' =\u003e (\n            metaclasses  =\u003e {\n                attribute =\u003e {\n                    isa  =\u003e [ 'Moose::Meta::Attribute' ],\n                    does =\u003e [ 'MetaRole::attribute'    ],\n                },\n            },\n        );\n\n    ...yields:\n\n        # Subtest: Checking the attribute metaclass, Moose::Meta::Class::__ANON__::SERIAL::1\n            ok 1 - TestClass's attribute metaclass has a metaclass\n            ok 2 - TestClass's attribute metaclass is a Moose class\n            ok 3 - TestClass's attribute metaclass isa Moose::Meta::Attribute\n            ok 4 - TestClass's attribute metaclass does MetaRole::attribute\n            1..4\n        ok 1 - Checking the attribute metaclass, Moose::Meta::Class::__ANON__::SERIAL::1\n\n    Note that `validate_class()` and `validate_role()` implement this using\n    `class_metaclasses` and `role_metaclasses`, respectively.\n\n## validate\\_role\n\nThe same as `validate_thing()`, but ensures `$thing` is a role, and allows\nfor additional role-specific tests.\n\n    validate_role $thing =\u003e (\n\n        required_methods =\u003e [ ... ],\n\n        # ...and all other options from validate_thing()\n    );\n\n- `-compose =\u003e 0|1`\n\n    When true, attempt to compose the role into an anonymous class, then use it to\n    run [\"validate\\_class\"](#validate_class).  The options we're given are passed to `validate_class()`\n    directly, except that any `required_methods` entry is removed and its contents\n    pushed onto `methods`.  (A stub method for each entry in `required_methods`\n    will also be created in the new class.)\n\n    e.g.:\n\n        ok 1 - TestRole has a metaclass\n        ok 2 - TestRole is a Moose role\n        ok 3 - TestRole requires method blargh\n        ok 4 - TestRole does TestRole\n        ok 5 - TestRole does not do TestRole::Two\n        ok 6 - TestRole has method method1\n        ok 7 - TestRole has an attribute named bar\n        # Subtest: role composed into Moose::Meta::Class::__ANON__::SERIAL::1\n            ok 1 - TestRole's composed class has a metaclass\n            ok 2 - TestRole's composed class is a Moose class\n            ok 3 - TestRole's composed class does TestRole\n            ok 4 - TestRole's composed class does not do TestRole::Two\n            ok 5 - TestRole's composed class has method method1\n            ok 6 - TestRole's composed class has method blargh\n            ok 7 - TestRole's composed class has an attribute named bar\n            1..7\n        ok 8 - role composed into Moose::Meta::Class::__ANON__::SERIAL::1\n        1..8\n\n- `-subtest =\u003e 'subtest name...'`\n\n    If set, all tests run will be wrapped in a subtest, the name of which will be\n    whatever `-subtest` is set to.\n\n- `required_methods =\u003e [ ... ]`\n\n    A list of methods the role requires a consuming class to supply.\n\n- `before =\u003e [ ... ]`\n\n    A list of methods the role expects to wrap before, on application to a class.\n\n    See [\"before\" in Moose](https://metacpan.org/pod/Moose#before) for information on before method modifiers.\n\n- `around =\u003e [ ... ]`\n\n    A list of methods the role expects to wrap around, on application to a class.\n\n    See [\"around\" in Moose](https://metacpan.org/pod/Moose#around) for information on around method modifiers.\n\n- `after =\u003e [ ... ]`\n\n    A list of methods the role expects to wrap after, on application to a class.\n\n    See [\"after\" in Moose](https://metacpan.org/pod/Moose#after) for information on after method modifiers.\n\n- `role_metaroles =\u003e { $mop =\u003e [ $role, ... ], ... }`\n\n    Checks metaclasses to ensure the given metaroles are applied.  See\n    [\"does\\_metaroles\\_ok\"](#does_metaroles_ok).\n\n- `no_role_metaroles =\u003e { $mop =\u003e [ $role, ... ], ... }`\n\n    Checks metaclasses to ensure the given metaroles are applied.  See\n    [\"does\\_not\\_metaroles\\_ok\"](#does_not_metaroles_ok).\n\n- `role_metaclasses =\u003e { $mop =\u003e { ... }, ... }`\n\n    Validates this role's metaclasses: that is, given a MOP type (e.g. role,\n    attribute, method, ...) and a hashref, find the associated metaclass of the\n    given type and invoke [\"validate\\_thing\"](#validate_thing) on it, using the hashref as options\n    for `validate_thing()`.\n\n    e.g.\n\n        validate_role 'TestRole' =\u003e (\n            metaclasses  =\u003e {\n                attribute =\u003e {\n                    isa  =\u003e [ 'Moose::Meta::Attribute' ],\n                    does =\u003e [ 'MetaRole::attribute'    ],\n                },\n            },\n        );\n\n    ...yields:\n\n        # Subtest: Checking the attribute metaclass, Moose::Meta::Class::__ANON__::SERIAL::1\n            ok 1 - TestRole's attribute metaclass has a metaclass\n            ok 2 - TestRole's attribute metaclass is a Moose class\n            ok 3 - TestRole's attribute metaclass isa Moose::Meta::Attribute\n            ok 4 - TestRole's attribute metaclass does MetaRole::attribute\n            1..4\n        ok 1 - Checking the attribute metaclass, Moose::Meta::Class::__ANON__::SERIAL::1\n\n    Note that `validate_class()` and `validate_role()` implement this using\n    `class_metaclasses` and `role_metaclasses`, respectively.\n\n- `class_metaclasses =\u003e { $mop =\u003e { ... }, ... }`\n\n    As with role\\_metaclasses, above, except that this option is only used\n    if `-compose` is also specified.\n\n## validate\\_class\n\nThe same as `validate_thing()`, but ensures `$thing` is a class, and allows\nfor additional class-specific tests.\n\n    validate_class $thing =\u003e (\n\n        isa  =\u003e [ ... ],\n\n        attributes =\u003e [ ... ],\n        methods    =\u003e [ ... ],\n\n        # ensures sugar is/is-not present\n        sugar      =\u003e 0,\n\n        # ensures $thing does these roles\n        does       =\u003e [ ... ],\n\n        # ensures $thing does not do these roles\n        does_not   =\u003e [ ... ],\n\n        # ...and all other options from validate_thing()\n    );\n\n- `-subtest =\u003e 'subtest name...'`\n\n    If set, all tests run will be wrapped in a subtest, the name of which will be\n    whatever `-subtest` is set to.\n\n- `immutable =\u003e 0|1`\n\n    Checks the class to see if it is/isn't immutable.\n\n- `class_metaroles =\u003e { $mop =\u003e [ $role, ... ], ... }`\n\n    Checks metaclasses to ensure the given metaroles are applied.  See\n    [\"does\\_metaroles\\_ok\"](#does_metaroles_ok).\n\n- `no_class_metaroles =\u003e { $mop =\u003e [ $role, ... ], ... }`\n\n    Checks metaclasses to ensure the given metaroles are applied.  See\n    [\"does\\_not\\_metaroles\\_ok\"](#does_not_metaroles_ok).\n\n- `class_metaclasses =\u003e { $mop =\u003e { ... }, ... }`\n\n    Validates this class' metaclasses: that is, given a MOP type (e.g. role,\n    attribute, method, ...) and a hashref, find the associated metaclass of the\n    given type and invoke [\"validate\\_thing\"](#validate_thing) on it, using the hashref as options\n    for `validate_thing()`.\n\n    e.g.\n\n        validate_class 'TestClass' =\u003e (\n            metaclasses  =\u003e {\n                attribute =\u003e {\n                    isa  =\u003e [ 'Moose::Meta::Attribute' ],\n                    does =\u003e [ 'MetaRole::attribute'    ],\n                },\n            },\n        );\n\n    ...yields:\n\n        ok 1 - TestClass has a metaclass\n        ok 2 - TestClass is a Moose class\n        # Subtest: Checking the attribute metaclass, Moose::Meta::Class::__ANON__::SERIAL::1\n            ok 1 - TestClass's attribute metaclass has a metaclass\n            ok 2 - TestClass's attribute metaclass is a Moose class\n            ok 3 - TestClass's attribute metaclass isa Moose::Meta::Attribute\n            ok 4 - TestClass's attribute metaclass does MetaRole::attribute\n            1..4\n        ok 3 - Checking the attribute metaclass, Moose::Meta::Class::__ANON__::SERIAL::1\n\n## validate\\_attribute\n\n`validate_attribute()` allows you to test how an attribute looks once built\nand attached to a class.\n\nLet's say you have an attribute defined like this:\n\n    has foo =\u003e (\n        traits  =\u003e [ 'TestRole' ],\n        is      =\u003e 'ro',\n        isa     =\u003e 'Int',\n        builder =\u003e '_build_foo',\n        lazy    =\u003e 1,\n    );\n\nYou can use `validate_attribute()` to ensure that it's built out in the way\nyou expect:\n\n    validate_attribute TestClass =\u003e foo =\u003e (\n\n        # tests the attribute metaclass instance to ensure it does the roles\n        -does =\u003e [ 'TestRole' ],\n        # tests the attribute metaclass instance's inheritance\n        -isa  =\u003e [ 'Moose::Meta::Attribute' ], # for demonstration's sake\n\n        traits   =\u003e [ 'TestRole' ],\n        isa      =\u003e 'Int',\n        does     =\u003e 'Bar',\n        handles  =\u003e { },\n        reader   =\u003e 'foo',\n        builder  =\u003e '_build_foo',\n        default  =\u003e undef,\n        init_arg =\u003e 'foo',\n        lazy     =\u003e 1,\n        required =\u003e undef,\n    );\n\nOptions passed to `validate_attribute()` prefixed with `-` test the\nattribute's metaclass instance rather than a setting on the attribute; that\nis, `-does` ensures that the metaclass does a particular role (e.g.\n[MooseX::AttributeShortcuts](https://metacpan.org/pod/MooseX::AttributeShortcuts)), while `does` tests the setting of the\nattribute to require the value do a given role.\n\nThis function takes all the options [\"attribute\\_options\\_ok\"](#attribute_options_ok) takes, as well as\nthe following:\n\n- `-subtest =\u003e 'subtest name...'`\n\n    If set, all tests run will be wrapped in a subtest, the name of which will be\n    whatever `-subtest` is set to.\n\n# SEE ALSO\n\nPlease see those modules/websites for more information related to this module.\n\n- [Test::Moose](https://metacpan.org/pod/Test::Moose)\n\n# BUGS\n\nPlease report any bugs or feature requests on the bugtracker website\n[https://github.com/RsrchBoy/Test-Moose-More/issues](https://github.com/RsrchBoy/Test-Moose-More/issues)\n\nWhen submitting a bug or request, please include a test-file or a\npatch to an existing test-file that illustrates the bug or desired\nfeature.\n\n# AUTHOR\n\nChris Weyl \u003ccweyl@alumni.drew.edu\u003e\n\n# CONTRIBUTORS\n\n- Chad Granum \u003cchad.granum@dreamhost.com\u003e\n- Karen Etheridge \u003cether@cpan.org\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is Copyright (c) 2017, 2016, 2015, 2014, 2013, 2012 by Chris Weyl.\n\nThis is free software, licensed under:\n\n    The GNU Lesser General Public License, Version 2.1, February 1999\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsrchboy%2Ftest-moose-more","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsrchboy%2Ftest-moose-more","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsrchboy%2Ftest-moose-more/lists"}