{
    "mode": "perldoc",
    "parameter": "Test::Moose",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Test%3A%3AMoose/json",
    "generated": "2026-06-12T05:00:07Z",
    "synopsis": "use Test::More plan => 1;\nuse Test::Moose;\nmetaok($classorobj, \"... Foo has a ->meta\");\ndoesok($classorobj, $role, \"... Foo does the Baz role\");\nhasattributeok($classorobj, $attrname, \"... Foo has the 'bar' attribute\");",
    "sections": {
        "NAME": {
            "content": "Test::Moose - Test functions for Moose specific features\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 2.2200\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Test::More plan => 1;\nuse Test::Moose;\n\nmetaok($classorobj, \"... Foo has a ->meta\");\ndoesok($classorobj, $role, \"... Foo does the Baz role\");\nhasattributeok($classorobj, $attrname, \"... Foo has the 'bar' attribute\");\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module provides some useful test functions for Moose based classes. It is an experimental\nfirst release, so comments and suggestions are very welcome.\n",
            "subsections": []
        },
        "EXPORTED FUNCTIONS": {
            "content": "metaok ($classorobject)\nTests if a class or object has a metaclass.\n\ndoesok ($classorobject, $role, ?$message)\nTests if a class or object does a certain role, similar to what \"isaok\" does for the \"isa\"\nmethod.\n\nhasattributeok($classorobject, $attrname, ?$message)\nTests if a class or object has a certain attribute, similar to what \"canok\" does for the\nmethods.\n\nwithimmutable { CODE } @classnames\nRuns CODE (which should contain normal tests) twice, and make each class in @classnames\nimmutable in between the two runs.\n\nThe CODE block is called with a single boolean argument indicating whether or not the classes\nhave been made immutable yet.\n",
            "subsections": []
        },
        "TODO": {
            "content": "Convert the Moose test suite to use this module.\nHere is a list of possible functions to write\n\nimmutability predicates\nanon-class predicates\ndiscovering original method from modified method\nattribute metaclass predicates (attributeisa?)\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Test::More\n",
            "subsections": []
        },
        "BUGS": {
            "content": "See \"BUGS\" in Moose for details on reporting bugs.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "*   Stevan Little <stevan@cpan.org>\n\n*   Dave Rolsky <autarch@urth.org>\n\n*   Jesse Luehrs <doy@cpan.org>\n\n*   Shawn M Moore <sartak@cpan.org>\n\n*   יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>\n\n*   Karen Etheridge <ether@cpan.org>\n\n*   Florian Ragwitz <rafl@debian.org>\n\n*   Hans Dieter Pearcey <hdp@cpan.org>\n\n*   Chris Prather <chris@prather.org>\n\n*   Matt S Trout <mstrout@cpan.org>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is copyright (c) 2006 by Infinity Interactive, Inc.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n",
            "subsections": []
        }
    },
    "summary": "Test::Moose - Test functions for Moose specific features",
    "flags": [],
    "examples": [],
    "see_also": []
}