Test-Moose-More-0.022/0000775000175000017500000000000012240102127014655 5ustar rsrchboyrsrchboyTest-Moose-More-0.022/README0000644000175000017500000001340512240102127015536 0ustar rsrchboyrsrchboyNAME Test::Moose::More - More tools for testing Moose packages VERSION This document describes version 0.022 of Test::Moose::More - released November 10, 2013 as part of Test-Moose-More. 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 replace Test::Moose in your tests, and re-exports any tests that it has and we do not, yet. 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. does_not_ok $thing, < $role | \@roles >, [ $message ] 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. has_attribute_ok $thing, $attribute_name, [ $message ] Checks $thing for an attribute named $attribute_name; $thing may be a class name, instance, or role name. has_method_ok $thing, @methods Queries $thing's metaclass to see if $thing has the methods named in @methods. requires_method_ok $thing, @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. is_role $thing Passes if $thing's metaclass is a Moose::Meta::Role. is_class $thing Passes if $thing's metaclass is a Moose::Meta::Class. is_anon $thing Passes if $thing is "anonymous". is_not_anon $thing Passes if $thing is not "anonymous". 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_thing 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. validate_role 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() validate_class The same as validate_thing(), but ensures $thing is a class, and allows for additional class-specific tests. validate_attribute validate_attribute() allows you to test how an attribute looks once built and attached to a class. Let's say you have an attribute defined like this: has foo => ( traits => [ 'TestRole' ], is => 'ro', isa => 'Int', builder => '_build_foo', lazy => 1, ); You can use validate_attribute() to ensure that it's built out in the way you expect: validate_attribute TestClass => foo => ( -does => [ 'TestRole' ], -isa => [ 'Moose::Meta::Attribute' ], # for demonstration's sake traits => [ 'TestRole' ], isa => 'Int', does => 'Bar', handles => { }, reader => 'foo', builder => '_build_foo', default => undef, init_arg => 'foo', lazy => 1, required => undef, ); Not yet documented or tested exhaustively; please see t/validate_attribute.t for details at the moment. This test routine is likely to change in implementation and scope, with every effort to maintain backwards compatibility. attribute_options_ok Validates that an attribute is set up as expected; like validate_attribute(), but only concerns itself with attribute options. Not yet documented or tested exhaustively; please see t/validate_attribute.t for details at the moment. This test routine is likely to change in implementation and scope, with every effort to maintain backwards compatibility. SEE ALSO Please see those modules/websites for more information related to this module. * Test::Moose SOURCE The development version is on github at and may be cloned from 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 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 Test-Moose-More-0.022/Changes0000644000175000017500000000704012240102127016147 0ustar rsrchboyrsrchboyRevision history for Test-Moose-More 0.022 2013-11-10 23:16:32 PST-0800 * ...and add an explicit dependency on TAP::SimpleOutput 0.002 0.021 2013-11-10 23:13:27 PST-0800 * Handle Test::More's new output for subtests in 0.98_05+ * Dodge isa_ok()'s output change by rolling our own 0.020 2013-08-01 07:33:57 PDT-0700 * Drop Perl6::Junction in favor of Syntax::Keyword::Junction Same thing -- essentially, AFAICT -- except that we don't get 'smartmatch operator is experimental' warnings in 5.18 :) 0.019 2013-01-21 07:35:07 PST-0800 * no code changes, netadata fixup only -- stop requiring Moose::Deprecated, as it is no longer indexed. 0.018 2013-01-09 07:48:01 PST8PDT * test if an attribute should coerce or not 0.017 2012-10-28 15:38:16 PST8PDT * Instead of failing on "unknown attribute options" when performing attribute validation checks, first look to see if they're actually an attribute on the attribute metaclass; this is a fairly common situation when attribute traits are used. * Check if an attribute is required or not. 0.016 2012-10-21 15:03:32 PST8PDT * add is_anon(), is_not_anon() * allow anonymous => 1|0 in validate_thing() (though not documented) * use validate_class() when checking attributes with validate_class() 0.015 2012-10-20 17:00:59 PST8PDT * NO CODE CHANGES from 0.014. We should be at a good point where the newer attribute checking tests are useable and won't need to change in any incompatible ways (hopefully!). 0.014 2012-10-04 20:28:49 PST8PDT * TRIAL release * better tests for our new validate_attribute and attribute_options_ok * use subtests when checking attributes in validate_class * drop t/funcs.pm in favor of TAP::SimpleOutput 0.013 2012-09-30 13:59:22 PST8PDT * TRIAL release * mark traits as a valid attribute option to test for, but not currently checked (skipped, that is). * Handle validating an attribute as a "thing" and its options at the same time by interperting all keys of options to check that start with '-' as a key for validate_thing(). This should allow the validate_*'s to pass off to validate_attribute() without much violence. 0.012 2012-09-29 23:18:12 PST8PDT * TRIAL release * add first pass at validate_attribute(), adapted from MooseX::AttributeShortcuts' test suite 0.011 2012-08-26 22:32:59 America/Los_Angeles * drop AttributeShortcuts req from t/, or we may run into build issues 0.010 2012-08-24 15:01:48 America/Los_Angeles * add has_required_methods_ok() * add required_methods() to validate_role(), and test 0.009 2012-04-26 22:34:16 America/Los_Angeles * initial (undocumented) attribute meta-validation via validate_*(). Undocumented until we settle on a coherent way to do this across the board. 0.008 2012-04-13 13:52:33 America/Los_Angeles * add has_attribute_ok, and extended to deal with attributes in roles, as the prior method seems to have stopped working. 0.007 2012-04-11 17:52:41 America/Los_Angeles * add does_not_ok() * add 'does_not' option to validate_thing()/etc 0.006 2012-04-07 23:19:40 America/Los_Angeles * fix POD and actually implement more of validate_thing() 0.005 2012-02-05 06:14:58 America/Los_Angeles * export Test::Moose::with_immutable() 0.004 2012-02-02 16:20:01 America/Los_Angeles * add does_ok(), meta_ok() 0.003 2012-01-23 15:15:39 America/Los_Angeles 0.002 2012-01-21 20:07:26 America/Los_Angeles * add check_sugar_ok and check_sugar_removed_ok 0.001 2012-01-21 10:52:14 America/Los_Angeles * initial release Test-Moose-More-0.022/LICENSE0000644000175000017500000006011112240102127015657 0ustar rsrchboyrsrchboyThis 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 The GNU Lesser General Public License (LGPL) Version 2.1, February 1999 (The master copy of this license lives on the GNU website.) Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Test-Moose-More-0.022/INSTALL0000644000175000017500000000172312240102127015707 0ustar rsrchboyrsrchboy This is the Perl distribution Test-Moose-More. Installing Test-Moose-More is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm Test::Moose::More If you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S Test::Moose::More ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan Test::Moose::More ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, then build it: % perl Makefile.PL % make && make test Then install it: % make install If you are installing into a system-wide directory, you may need to run: % sudo make install ## Documentation Test-Moose-More documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc Test::Moose::More Test-Moose-More-0.022/dist.ini0000644000175000017500000000075012240102127016321 0ustar rsrchboyrsrchboyname = Test-Moose-More author = Chris Weyl license = LGPL_2_1 copyright_holder = Chris Weyl copyright_year = 2012 [@RSRCHBOY] ;tweet = 1 autoprereqs_skip = ^(funcs|TestClass.*|TestRole.*)$ ReportVersions::Tiny.include[0] = Moose ReportVersions::Tiny.include[1] = Class::MOP [RemovePrereqs] ; this was excluded from cpan indexing around 2.0002, so depending on it leads ; to predictably fun mouse-in-a-wheel debugging sessions :\ remove = Moose::Deprecated Test-Moose-More-0.022/MANIFEST0000644000175000017500000000126412240102127016007 0ustar rsrchboyrsrchboy.travis.yml Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README SIGNATURE cpanfile dist.ini lib/Test/Moose/More.pm t/00-check-deps.t t/00-compile.t t/000-report-versions-tiny.t t/attribute/coerce.t t/author-pod-spell.t t/check_sugar.t t/does_not_ok.t t/does_ok.t t/has_attribute_ok.t t/has_method_ok.t t/is_anon.t t/is_class.t t/is_not_anon.t t/is_role.t t/meta_ok.t t/release-consistent-version.t t/release-eol.t t/release-has-version.t t/release-minimum-version.t t/release-no-smart-comments.t t/release-no-tabs.t t/release-pod-coverage.t t/release-pod-linkcheck.t t/release-pod-syntax.t t/requires_method_ok.t t/validate_attribute.t t/validate_class.t t/validate_role.t Test-Moose-More-0.022/META.yml0000644000175000017500000002447312240102127016136 0ustar rsrchboyrsrchboy--- abstract: 'More tools for testing Moose packages' author: - 'Chris Weyl ' build_requires: File::Spec: 0 IO::Handle: 0 IPC::Open3: 0 Moose: 0 Moose::Role: 0 Perl::Version: 0 TAP::SimpleOutput: 0.002 Test::Builder::Tester: 0 Test::CheckDeps: 0.010 Test::More: 0.94 aliased: 0 constant: 0 namespace::autoclean: 0 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.132830' license: lgpl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Test-Moose-More no_index: directory: - corpus - t provides: Test::Moose::More: file: lib/Test/Moose/More.pm version: 0.022 requires: Data::OptList: 0 Moose::Autobox: 0 Moose::Util: 0 Moose::Util::TypeConstraints: 0 Scalar::Util: 0 Sub::Exporter: 0 Syntax::Keyword::Junction: 0 Test::Builder: 0 Test::Moose: 0 Test::More: 0.94 perl: 5.006 strict: 0 warnings: 0 resources: bugtracker: https://github.com/RsrchBoy/Test-Moose-More/issues homepage: http://metacpan.org/release/Test-Moose-More/ repository: git://github.com/RsrchBoy/Test-Moose-More.git version: 0.022 x_Dist_Zilla: perl: version: 5.018001 plugins: - class: Dist::Zilla::Plugin::NextRelease name: '@RSRCHBOY/NextRelease' version: 5.006 - class: Dist::Zilla::Plugin::Git::NextVersion name: '@RSRCHBOY/Git::NextVersion' version: 2.017 - class: Dist::Zilla::Plugin::ContributorsFromGit name: '@RSRCHBOY/ContributorsFromGit' version: 0.006 - class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch name: '@RSRCHBOY/@Git::CheckFor/Git::CheckFor::CorrectBranch' version: 0.008 - class: Dist::Zilla::Plugin::Git::CheckFor::Fixups name: '@RSRCHBOY/@Git::CheckFor/Git::CheckFor::Fixups' version: 0.008 - class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts name: '@RSRCHBOY/@Git::CheckFor/Git::CheckFor::MergeConflicts' version: 0.008 - class: Dist::Zilla::Plugin::GatherDir name: '@RSRCHBOY/GatherDir' version: 5.006 - class: Dist::Zilla::Plugin::PromptIfStale name: '@RSRCHBOY/PromptIfStale' version: 0.009 - class: Dist::Zilla::Plugin::PruneCruft name: '@RSRCHBOY/PruneCruft' version: 5.006 - class: Dist::Zilla::Plugin::Git::Describe name: '@RSRCHBOY/Git::Describe' version: 0.003 - class: Dist::Zilla::Plugin::ExecDir name: '@RSRCHBOY/ExecDir' version: 5.006 - class: Dist::Zilla::Plugin::ShareDir name: '@RSRCHBOY/ShareDir' version: 5.006 - class: Dist::Zilla::Plugin::MakeMaker name: '@RSRCHBOY/MakeMaker' version: 5.006 - class: Dist::Zilla::Plugin::InstallGuide name: '@RSRCHBOY/InstallGuide' version: 1.200001 - class: Dist::Zilla::Plugin::Manifest name: '@RSRCHBOY/Manifest' version: 5.006 - class: Dist::Zilla::Plugin::SurgicalPkgVersion name: '@RSRCHBOY/SurgicalPkgVersion' version: 0.0019 - class: Dist::Zilla::Plugin::ReadmeFromPod name: '@RSRCHBOY/ReadmeFromPod' version: 0.21 - class: Dist::Zilla::Plugin::MinimumPerl name: '@RSRCHBOY/MinimumPerl' version: 1.003 - class: Dist::Zilla::Plugin::ReportVersions::Tiny name: '@RSRCHBOY/ReportVersions::Tiny' version: 1.10 - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RSRCHBOY/AutoPrereqs' version: 5.006 - class: Dist::Zilla::Plugin::Prepender name: '@RSRCHBOY/Prepender' version: 1.112280 - class: Dist::Zilla::Plugin::Test::PodSpelling name: '@RSRCHBOY/Test::PodSpelling' version: 2.006001 - class: Dist::Zilla::Plugin::ConsistentVersionTest name: '@RSRCHBOY/ConsistentVersionTest' version: 0.02 - class: Dist::Zilla::Plugin::PodCoverageTests name: '@RSRCHBOY/PodCoverageTests' version: 5.006 - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RSRCHBOY/PodSyntaxTests' version: 5.006 - class: Dist::Zilla::Plugin::NoTabsTests config: Dist::Zilla::Plugin::Test::NoTabs: module_finder: - ':InstallModules' script_finder: - ':ExecFiles' name: '@RSRCHBOY/NoTabsTests' version: 0.05 - class: Dist::Zilla::Plugin::EOLTests name: '@RSRCHBOY/EOLTests' version: 0.02 - class: Dist::Zilla::Plugin::HasVersionTests name: '@RSRCHBOY/HasVersionTests' version: 1.101420 - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: filename: t/00-compile.t module_finder: - ':InstallModules' script_finder: - ':ExecFiles' name: '@RSRCHBOY/Test::Compile' version: 2.037 - class: Dist::Zilla::Plugin::ExtraTests name: '@RSRCHBOY/ExtraTests' version: 5.006 - class: Dist::Zilla::Plugin::NoSmartCommentsTests name: '@RSRCHBOY/NoSmartCommentsTests' version: 0.006 - class: Dist::Zilla::Plugin::Test::Pod::LinkCheck name: '@RSRCHBOY/Test::Pod::LinkCheck' version: 1.001 - class: Dist::Zilla::Plugin::Test::MinimumVersion name: '@RSRCHBOY/Test::MinimumVersion' version: 2.000005 - class: Dist::Zilla::Plugin::Authority name: '@RSRCHBOY/Authority' version: 1.006 - class: Dist::Zilla::Plugin::MetaConfig name: '@RSRCHBOY/MetaConfig' version: 5.006 - class: Dist::Zilla::Plugin::MetaJSON name: '@RSRCHBOY/MetaJSON' version: 5.006 - class: Dist::Zilla::Plugin::MetaYAML name: '@RSRCHBOY/MetaYAML' version: 5.006 - class: Dist::Zilla::Plugin::MetaNoIndex name: '@RSRCHBOY/MetaNoIndex' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: '@RSRCHBOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: 5.006 - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: {} Dist::Zilla::Role::MetaProvider::Provider: inherit_missing: 1 inherit_version: 1 meta_noindex: 1 name: '@RSRCHBOY/MetaProvides::Package' version: 1.15000000 - class: Dist::Zilla::Plugin::GitHub::Meta name: '@RSRCHBOY/GitHub::Meta' version: 0.35 - class: Dist::Zilla::Plugin::TestRelease name: '@RSRCHBOY/TestRelease' version: 5.006 - class: Dist::Zilla::Plugin::CheckChangesHasContent name: '@RSRCHBOY/CheckChangesHasContent' version: 0.006 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RSRCHBOY/CheckPrereqsIndexed' version: 0.009 - class: Dist::Zilla::Plugin::Git::Remote::Update name: '@RSRCHBOY/GitFetchOrigin' version: 0.1.2 - class: Dist::Zilla::Plugin::Git::Remote::Check name: '@RSRCHBOY/GitCheckReleaseBranchSync' version: 0.1.2 - class: Dist::Zilla::Plugin::Git::Remote::Check name: '@RSRCHBOY/GitCheckMasterBranchSync' version: 0.1.2 - class: Dist::Zilla::Plugin::Git::Check name: '@RSRCHBOY/Git::Check' version: 2.017 - class: Dist::Zilla::Plugin::Git::Commit name: '@RSRCHBOY/Git::Commit' version: 2.017 - class: Dist::Zilla::Plugin::Test::CheckDeps name: '@RSRCHBOY/Test::CheckDeps' version: 0.010 - class: Dist::Zilla::Plugin::Travis::ConfigForReleaseBranch name: '@RSRCHBOY/Travis::ConfigForReleaseBranch' version: 0.001 - class: Dist::Zilla::Plugin::Git::Tag name: '@RSRCHBOY/Git::Tag' version: 2.017 - class: Dist::Zilla::Plugin::Git::CommitBuild name: '@RSRCHBOY/Git::CommitBuild' version: 2.017 - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RSRCHBOY/UploadToCPAN' version: 5.006 - class: Dist::Zilla::Plugin::Git::Push name: '@RSRCHBOY/Git::Push' version: 2.017 - class: Dist::Zilla::Plugin::Signature name: '@RSRCHBOY/Signature' version: 1.100930 - class: Dist::Zilla::Plugin::InstallRelease name: '@RSRCHBOY/InstallRelease' version: 0.008 - class: Dist::Zilla::Plugin::GitHub::Update name: '@RSRCHBOY/GitHub::Update' version: 0.35 - class: Dist::Zilla::Plugin::ArchiveRelease name: '@RSRCHBOY/ArchiveRelease' version: 4.00 - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RSRCHBOY/ConfirmRelease' version: 5.006 - class: Dist::Zilla::Plugin::License name: '@RSRCHBOY/License' version: 5.006 - class: Dist::Zilla::Plugin::CPANFile name: '@RSRCHBOY/CPANFile' version: 5.006 - class: Dist::Zilla::Plugin::CopyFilesFromBuild name: '@RSRCHBOY/CopyFilesFromBuild' version: 0.103510 - class: Dist::Zilla::Plugin::ReadmeAnyFromPod name: '@RSRCHBOY/ReadmeMarkdownInRoot' version: 0.131500 - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugin: '@RSRCHBOY' finder: - ':InstallModules' - ':ExecFiles' name: '@RSRCHBOY/PodWeaver' version: 4.001 - class: Dist::Zilla::Plugin::RemovePrereqs config: Dist::Zilla::Plugin::RemovePrereqs: modules_to_remove: - Moose::Deprecated name: RemovePrereqs version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: 5.006 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: 5.006 x_authority: cpan:RSRCHBOY Test-Moose-More-0.022/cpanfile0000644000175000017500000000232112240102127016355 0ustar rsrchboyrsrchboyrequires "Data::OptList" => "0"; requires "Moose::Autobox" => "0"; requires "Moose::Util" => "0"; requires "Moose::Util::TypeConstraints" => "0"; requires "Scalar::Util" => "0"; requires "Sub::Exporter" => "0"; requires "Syntax::Keyword::Junction" => "0"; requires "Test::Builder" => "0"; requires "Test::Moose" => "0"; requires "Test::More" => "0.94"; requires "perl" => "5.006"; requires "strict" => "0"; requires "warnings" => "0"; on 'test' => sub { requires "File::Spec" => "0"; requires "IO::Handle" => "0"; requires "IPC::Open3" => "0"; requires "Moose" => "0"; requires "Moose::Role" => "0"; requires "Perl::Version" => "0"; requires "TAP::SimpleOutput" => "0.002"; requires "Test::Builder::Tester" => "0"; requires "Test::CheckDeps" => "0.010"; requires "Test::More" => "0.94"; requires "aliased" => "0"; requires "constant" => "0"; requires "namespace::autoclean" => "0"; }; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "6.30"; }; on 'develop' => sub { requires "Pod::Coverage::TrustPod" => "0"; requires "Test::More" => "0"; requires "Test::NoTabs" => "0"; requires "Test::Pod" => "1.41"; requires "Test::Pod::Coverage" => "1.08"; requires "version" => "0.9901"; }; Test-Moose-More-0.022/META.json0000644000175000017500000003750712240102127016310 0ustar rsrchboyrsrchboy{ "abstract" : "More tools for testing Moose packages", "author" : [ "Chris Weyl " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.132830", "license" : [ "lgpl_2_1" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Test-Moose-More", "no_index" : { "directory" : [ "corpus", "t" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::More" : "0", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "version" : "0.9901" } }, "runtime" : { "requires" : { "Data::OptList" : "0", "Moose::Autobox" : "0", "Moose::Util" : "0", "Moose::Util::TypeConstraints" : "0", "Scalar::Util" : "0", "Sub::Exporter" : "0", "Syntax::Keyword::Junction" : "0", "Test::Builder" : "0", "Test::Moose" : "0", "Test::More" : "0.94", "perl" : "5.006", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Moose" : "0", "Moose::Role" : "0", "Perl::Version" : "0", "TAP::SimpleOutput" : "0.002", "Test::Builder::Tester" : "0", "Test::CheckDeps" : "0.010", "Test::More" : "0.94", "aliased" : "0", "constant" : "0", "namespace::autoclean" : "0" } } }, "provides" : { "Test::Moose::More" : { "file" : "lib/Test/Moose/More.pm", "version" : "0.022" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/RsrchBoy/Test-Moose-More/issues" }, "homepage" : "http://metacpan.org/release/Test-Moose-More/", "repository" : { "type" : "git", "url" : "git://github.com/RsrchBoy/Test-Moose-More.git", "web" : "https://github.com/RsrchBoy/Test-Moose-More" } }, "version" : "0.022", "x_Dist_Zilla" : { "perl" : { "version" : "5.018001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RSRCHBOY/NextRelease", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "name" : "@RSRCHBOY/Git::NextVersion", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::ContributorsFromGit", "name" : "@RSRCHBOY/ContributorsFromGit", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", "name" : "@RSRCHBOY/@Git::CheckFor/Git::CheckFor::CorrectBranch", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::Fixups", "name" : "@RSRCHBOY/@Git::CheckFor/Git::CheckFor::Fixups", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", "name" : "@RSRCHBOY/@Git::CheckFor/Git::CheckFor::MergeConflicts", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::GatherDir", "name" : "@RSRCHBOY/GatherDir", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "name" : "@RSRCHBOY/PromptIfStale", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RSRCHBOY/PruneCruft", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Git::Describe", "name" : "@RSRCHBOY/Git::Describe", "version" : "0.003" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RSRCHBOY/ExecDir", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RSRCHBOY/ShareDir", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "name" : "@RSRCHBOY/MakeMaker", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "name" : "@RSRCHBOY/InstallGuide", "version" : "1.200001" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RSRCHBOY/Manifest", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::SurgicalPkgVersion", "name" : "@RSRCHBOY/SurgicalPkgVersion", "version" : "0.0019" }, { "class" : "Dist::Zilla::Plugin::ReadmeFromPod", "name" : "@RSRCHBOY/ReadmeFromPod", "version" : "0.21" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@RSRCHBOY/MinimumPerl", "version" : "1.003" }, { "class" : "Dist::Zilla::Plugin::ReportVersions::Tiny", "name" : "@RSRCHBOY/ReportVersions::Tiny", "version" : "1.10" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RSRCHBOY/AutoPrereqs", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Prepender", "name" : "@RSRCHBOY/Prepender", "version" : "1.112280" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "name" : "@RSRCHBOY/Test::PodSpelling", "version" : "2.006001" }, { "class" : "Dist::Zilla::Plugin::ConsistentVersionTest", "name" : "@RSRCHBOY/ConsistentVersionTest", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@RSRCHBOY/PodCoverageTests", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RSRCHBOY/PodSyntaxTests", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::NoTabsTests", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "module_finder" : [ ":InstallModules" ], "script_finder" : [ ":ExecFiles" ] } }, "name" : "@RSRCHBOY/NoTabsTests", "version" : "0.05" }, { "class" : "Dist::Zilla::Plugin::EOLTests", "name" : "@RSRCHBOY/EOLTests", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::HasVersionTests", "name" : "@RSRCHBOY/HasVersionTests", "version" : "1.101420" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "script_finder" : [ ":ExecFiles" ] } }, "name" : "@RSRCHBOY/Test::Compile", "version" : "2.037" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "@RSRCHBOY/ExtraTests", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::NoSmartCommentsTests", "name" : "@RSRCHBOY/NoSmartCommentsTests", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::LinkCheck", "name" : "@RSRCHBOY/Test::Pod::LinkCheck", "version" : "1.001" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "name" : "@RSRCHBOY/Test::MinimumVersion", "version" : "2.000005" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@RSRCHBOY/Authority", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RSRCHBOY/MetaConfig", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RSRCHBOY/MetaJSON", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RSRCHBOY/MetaYAML", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@RSRCHBOY/MetaNoIndex", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@RSRCHBOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : {}, "Dist::Zilla::Role::MetaProvider::Provider" : { "inherit_missing" : "1", "inherit_version" : "1", "meta_noindex" : "1" } }, "name" : "@RSRCHBOY/MetaProvides::Package", "version" : "1.15000000" }, { "class" : "Dist::Zilla::Plugin::GitHub::Meta", "name" : "@RSRCHBOY/GitHub::Meta", "version" : "0.35" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RSRCHBOY/TestRelease", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", "name" : "@RSRCHBOY/CheckChangesHasContent", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RSRCHBOY/CheckPrereqsIndexed", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Update", "name" : "@RSRCHBOY/GitFetchOrigin", "version" : "0.1.2" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Check", "name" : "@RSRCHBOY/GitCheckReleaseBranchSync", "version" : "0.1.2" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Check", "name" : "@RSRCHBOY/GitCheckMasterBranchSync", "version" : "0.1.2" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "@RSRCHBOY/Git::Check", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "@RSRCHBOY/Git::Commit", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::Test::CheckDeps", "name" : "@RSRCHBOY/Test::CheckDeps", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::Travis::ConfigForReleaseBranch", "name" : "@RSRCHBOY/Travis::ConfigForReleaseBranch", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "@RSRCHBOY/Git::Tag", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::Git::CommitBuild", "name" : "@RSRCHBOY/Git::CommitBuild", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RSRCHBOY/UploadToCPAN", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "name" : "@RSRCHBOY/Git::Push", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::Signature", "name" : "@RSRCHBOY/Signature", "version" : "1.100930" }, { "class" : "Dist::Zilla::Plugin::InstallRelease", "name" : "@RSRCHBOY/InstallRelease", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "name" : "@RSRCHBOY/GitHub::Update", "version" : "0.35" }, { "class" : "Dist::Zilla::Plugin::ArchiveRelease", "name" : "@RSRCHBOY/ArchiveRelease", "version" : "4.00" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RSRCHBOY/ConfirmRelease", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RSRCHBOY/License", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::CPANFile", "name" : "@RSRCHBOY/CPANFile", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromBuild", "name" : "@RSRCHBOY/CopyFilesFromBuild", "version" : "0.103510" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "name" : "@RSRCHBOY/ReadmeMarkdownInRoot", "version" : "0.131500" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugin" : "@RSRCHBOY", "finder" : [ ":InstallModules", ":ExecFiles" ] } }, "name" : "@RSRCHBOY/PodWeaver", "version" : "4.001" }, { "class" : "Dist::Zilla::Plugin::RemovePrereqs", "config" : { "Dist::Zilla::Plugin::RemovePrereqs" : { "modules_to_remove" : [ "Moose::Deprecated" ] } }, "name" : "RemovePrereqs", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "5.006" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "5.006" } }, "x_authority" : "cpan:RSRCHBOY" } Test-Moose-More-0.022/SIGNATURE0000644000175000017500000000673212240102127016147 0ustar rsrchboyrsrchboyThis file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.73. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 SHA1 55ac697642a18dd7d974736a3d06fd531aa82382 .travis.yml SHA1 b0614f225e036dd67feee68f5d9033e7dc9ad313 Changes SHA1 bf012241a3405c7459e184487c9016381ef89c2d INSTALL SHA1 05207cbc5971035849c1de2c7cb3babaeaccb6fb LICENSE SHA1 1852f5152db928981641ff05f7284f25d550e485 MANIFEST SHA1 d7c00f4cc31248000757d22617d4fb48207d8f3b META.json SHA1 dd26ab2d5f60ab341f6ac74c553e00521cd8e2ff META.yml SHA1 ae4cd131abc6990253f1a1a6c2003bc97f02f2ca Makefile.PL SHA1 70dd7efb37726eb3c9668242eee5e4a75d25a1d2 README SHA1 f1af8b2eba490f0a1a38838642fa98aa64f15db9 cpanfile SHA1 4897c2227dced7368e98e53ccde3eb9929296bb3 dist.ini SHA1 ee0c68f3dae56b2984c7b554fa763cf214712017 lib/Test/Moose/More.pm SHA1 38f7e2fa39c5ae49b1e3835c93b540e4ca5f9ecb t/00-check-deps.t SHA1 eb1f1c2815e2277a5093c47d448c1932924be5cd t/00-compile.t SHA1 a62b6c5bfc74894e96d5a4bb08c375d0e84bbf52 t/000-report-versions-tiny.t SHA1 1d0f344cfedae8633b9404fe4825b4227167a8ac t/attribute/coerce.t SHA1 9839ce0145b951c94ca2e31dce65387ca13bd7ae t/author-pod-spell.t SHA1 184cd396cdd45481169f5248992011f8ec90392d t/check_sugar.t SHA1 2b36ce7cc4fee13acdc6ce3748cfb57cd6a1dffb t/does_not_ok.t SHA1 c99877f39ec141a5e54d565feac04254e40bab6b t/does_ok.t SHA1 6d28f78d54ce90d525713095c5b350cee4b3d7f5 t/has_attribute_ok.t SHA1 2c5c501fa1761d05c7c1edd53a4e5481be7b5f87 t/has_method_ok.t SHA1 f19ee32cd706162430cf6c9be937688a7919e2c2 t/is_anon.t SHA1 1a31c52a354370a625c458d840d0db70a05c55ce t/is_class.t SHA1 da364d4a157f0ae40c9da224d829f83c4951ffd2 t/is_not_anon.t SHA1 bfef3460be8109ac0ff0147c47af8a0842350135 t/is_role.t SHA1 4e15b688710f882cf42c2453db1b4b0827c64f4f t/meta_ok.t SHA1 9c3627ff37f4fd5bddc34bf46cf3359eaf76a060 t/release-consistent-version.t SHA1 a032c41ef6887fab1b900669c2d304fab46680e2 t/release-eol.t SHA1 17feb05324a6c6a9da573cab7ed91788d4f37464 t/release-has-version.t SHA1 219eda997f103a90fc5a381fad4c464799ef8da4 t/release-minimum-version.t SHA1 89b1b08b02975d3b94f52ba97b9d780357ca5f85 t/release-no-smart-comments.t SHA1 5432a4baa7448be0965967baf94800a3f7fd4404 t/release-no-tabs.t SHA1 adddf092c2865b394b42c99b19fe7b8a94281f11 t/release-pod-coverage.t SHA1 16f3d51ec9ccd96d151805f32abe5926b76e35c2 t/release-pod-linkcheck.t SHA1 925cb6ab3159c6892d7499960ee83f33721c26fa t/release-pod-syntax.t SHA1 9ce9fc8e942d7e32857562172190ea0932d4634b t/requires_method_ok.t SHA1 8417ad1ff196ed44bdb88862a00e7062af6087be t/validate_attribute.t SHA1 b14a9eaa41296de9df5b04f7928fa0397961438c t/validate_class.t SHA1 6bf2c6fdfbd0975dcd70747415e8a5e8cf8ce677 t/validate_role.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJSgIRWAAoJEOd5N1CvIgQkx7MIAIfLcp6nRiWF1pMpJpfEQbGt X5R5lMxVfK98nGwmtIha4eLwApHQBe/KiFjnsjvUQrtd3rSykaH+VMAX2zKsfxG2 InddsBgf0Lldf0uzEKmY0o65sXBBC5PvKwiOaYXbqjRG4Xa6SjsaDUX0Hfb/F3xI ckP406E4B5aXHQdWpvfPV48BuwFqh842Y4WpWouND/77gx6IThOBIWwC4Gpnr+ys iR4g4BzzI/MZIW3qtV6iOAwtbVne6IElooWfpaiMuO4om4lXJdvYgYSrX68Jeh29 J67rkM2RGjrlgNdkRIM0GLioTK3YEZvKavheb6K1tw2/9ii7G9bmD6WZdRXCUP4= =JcD7 -----END PGP SIGNATURE----- Test-Moose-More-0.022/t/0000775000175000017500000000000012240102127015120 5ustar rsrchboyrsrchboyTest-Moose-More-0.022/t/is_role.t0000644000175000017500000000145512240102127016744 0ustar rsrchboyrsrchboyuse strict; use warnings; { package TestRole; use Moose::Role; } { package TestClass; use Moose; } { package TestClass::NotMoosey; } use Test::Builder::Tester; # tests => 1; use Test::More; use Test::Moose::More; # is_role vs role test_out 'ok 1 - TestRole has a metaclass'; test_out 'ok 2 - TestRole is a Moose role'; is_role 'TestRole'; test_test 'is_role works correctly'; # is_role vs class test_out 'ok 1 - TestClass has a metaclass'; test_out 'not ok 2 - TestClass is a Moose role'; test_fail(1); is_role 'TestClass'; test_test 'is_role works correctly with classes'; # is_role vs plain-old-package test_out 'not ok 1 - TestClass::NotMoosey has a metaclass'; test_fail(1); is_role 'TestClass::NotMoosey'; test_test 'is_role works correctly with plain-old-packages'; done_testing; Test-Moose-More-0.022/t/does_ok.t0000644000175000017500000000765212240102127016740 0ustar rsrchboyrsrchboyuse strict; use warnings; { package TestRole::Role; use Moose::Role; } { package TestRole::Role2; use Moose::Role; } { package TestRole; use Moose::Role; with 'TestRole::Role'; } { package TestClass; use Moose; with 'TestRole::Role'; } { package TestRole::Two; use Moose::Role; with 'TestRole::Role'; with 'TestRole::Role2'; } { package TestClass::Two; use Moose; with 'TestRole::Role'; with 'TestRole::Role2'; } { package TestRole::Fail; use Moose::Role; } { package TestClass::Fail; use Moose; } { package TestRole::Fail2; use Moose::Role; with 'TestRole::Role2'; } { package TestClass::Fail2; use Moose; with 'TestRole::Role2'; } { package TestClass::NotMoosey; } use Test::Builder::Tester; use Test::More; use Test::Moose::More; use TAP::SimpleOutput 'counters'; my $ROLE = 'TestRole::Role'; my @ROLES = qw{ TestRole::Role TestRole::Role2 }; note 'single role, default message - OK'; for my $thing (qw{ TestClass TestRole }) { my ($_ok, $_nok) = counters(); test_out $_ok->("$thing does $ROLE"); does_ok $thing, $ROLE; test_test "$thing is found to do $ROLE correctly"; } note 'single role, custom message - OK'; for my $thing (qw{ TestClass TestRole }) { my ($_ok, $_nok) = counters(); test_out $_ok->('wah-wah'); does_ok $thing, $ROLE, 'wah-wah'; test_test "$thing: custom messages work as expected"; } note 'single role, "complex" custom message - OK'; for my $thing (qw{ TestClass TestRole }) { my ($_ok, $_nok) = counters(); test_out $_ok->("wah-wah $ROLE"); does_ok $thing, $ROLE, 'wah-wah %s'; test_test "$thing: 'complex' custom messages work as expected"; } note 'multiple roles, default message - OK'; for my $thing (qw{ TestClass::Two TestRole::Two }) { # role - OK my ($_ok, $_nok) = counters(); test_out $_ok->("$thing does $_") for @ROLES; does_ok $thing, [ @ROLES ]; test_test "$thing is found to do the roles correctly"; } note 'multiple roles, custom message - OK'; for my $thing (qw{ TestClass::Two TestRole::Two }) { # role - OK my ($_ok, $_nok) = counters(); my $msg = 'wah-wah'; test_out $_ok->($msg) for @ROLES; does_ok $thing, [ @ROLES ], $msg; test_test "$thing: multiple roles, custom messages work as expected"; } note 'multiple roles, "complex" custom message - OK'; for my $thing (qw{ TestClass::Two TestRole::Two }) { # role - OK my ($_ok, $_nok) = counters(); my $msg = 'wah-wah'; test_out $_ok->("$msg $_") for @ROLES; does_ok $thing, [ @ROLES ], "$msg %s"; test_test "$thing: multiple roles, 'complex' custom messages work as expected"; } note 'role - NOT OK'; for my $thing (qw{ TestClass::Fail TestRole::Fail }) { # role - NOT OK my ($_ok, $_nok) = counters(); test_out $_nok->("$thing does $ROLE"); test_fail 1; does_ok $thing, $ROLE; test_test "$thing is found to not do $ROLE correctly"; } note 'multiple roles - NOT OK'; for my $thing (qw{ TestClass::Fail TestRole::Fail }) { # role - OK my ($_ok, $_nok) = counters(); do { test_out $_nok->("$thing does $_"); test_fail 1 } for @ROLES; does_ok $thing, [ @ROLES ]; test_test "$thing: multiple roles fail as expected"; } note 'multiple roles - PARTIALLY OK'; for my $thing (qw{ TestClass::Fail2 TestRole::Fail2 }) { # role - OK my ($_ok, $_nok) = counters(); do { test_out $_nok->("$thing does $_"); test_fail 2 } for $ROLES[0]; do { test_out $_ok->("$thing does $_") } for $ROLES[1]; does_ok $thing, [ @ROLES ]; test_test "$thing: multiple roles partially fail as expected"; } done_testing; Test-Moose-More-0.022/t/meta_ok.t0000644000175000017500000000141212240102127016720 0ustar rsrchboyrsrchboyuse strict; use warnings; { package TestRole; use Moose::Role; } { package TestClass; use Moose; } { package TestClass::Fail; } use Test::Builder::Tester; # tests => 1; use Test::More; use Test::Moose::More; use TAP::SimpleOutput 'counters'; my $ROLE = 'TestRole::Role'; for my $thing (qw{ TestClass TestRole }) { # role - OK my ($_ok, $_nok) = counters(); test_out $_ok->("$thing has a meta"); meta_ok $thing; test_test "$thing is found to have a metaclass correctly"; } for my $thing (qw{ TestClass::Fail }) { # role - NOT OK my ($_ok, $_nok) = counters(); test_out $_nok->("$thing has a meta"); test_fail 1; meta_ok $thing; test_test "$thing is found to not have a metaclass correctly"; } done_testing; Test-Moose-More-0.022/t/is_anon.t0000644000175000017500000000245512240102127016737 0ustar rsrchboyrsrchboyuse strict; use warnings; use Test::Builder::Tester; use Moose::Util 'with_traits'; use Test::More; use Test::Moose::More; use TAP::SimpleOutput 'counters'; { package TestRole; use Moose::Role; use namespace::autoclean; } { package TestClass; use Moose; } # initial tests, covering the most straight-forward cases (IMHO) my $anon_class = with_traits('TestClass' => 'TestRole'); my $anon_role = Moose::Meta::Role ->create_anon_role(weaken => 0) ->name ; note 'simple anon class'; { my ($_ok, $_nok, $_skip) = counters(); test_out $_ok->("$anon_class is anonymous"); is_anon $anon_class; test_test 'is_anon works correctly on anon class'; } note 'simple anon role'; { my ($_ok, $_nok, $_skip) = counters(); test_out $_ok->("$anon_role is anonymous"); is_anon $anon_role; test_test 'is_anon works correctly on anon role'; } note 'simple !anon class'; { my ($_ok, $_nok, $_skip) = counters(); test_out $_nok->('TestClass is anonymous'); test_fail 1; is_anon 'TestClass'; test_test 'is_anon works correctly on !anon class'; } note 'simple !anon role'; { my ($_ok, $_nok, $_skip) = counters(); test_out $_nok->('TestRole is anonymous'); test_fail 1; is_anon 'TestRole'; test_test 'is_anon works correctly on !anon role'; } done_testing; Test-Moose-More-0.022/t/is_class.t0000644000175000017500000000147012240102127017105 0ustar rsrchboyrsrchboyuse strict; use warnings; { package TestRole; use Moose::Role; } { package TestClass; use Moose; } { package TestClass::NotMoosey; } use Test::Builder::Tester; # tests => 1; use Test::More; use Test::Moose::More; # is_class vs role test_out 'ok 1 - TestRole has a metaclass'; test_out 'not ok 2 - TestRole is a Moose class'; test_fail(1); is_class 'TestRole'; test_test 'is_class works correctly'; # is_class vs class test_out 'ok 1 - TestClass has a metaclass'; test_out 'ok 2 - TestClass is a Moose class'; is_class 'TestClass'; test_test 'is_class works correctly with classes'; # is_class vs plain-old-package test_out 'not ok 1 - TestClass::NotMoosey has a metaclass'; test_fail(1); is_class 'TestClass::NotMoosey'; test_test 'is_class works correctly with plain-old-packages'; done_testing; Test-Moose-More-0.022/t/00-compile.t0000644000175000017500000000171412240102127017153 0ustar rsrchboyrsrchboyuse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.037 use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Test/Moose/More.pm' ); # no fake home requested my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; use File::Spec; use IPC::Open3; use IO::Handle; my @warnings; for my $lib (@module_files) { # see L open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my $stderr = IO::Handle->new; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING}; Test-Moose-More-0.022/t/check_sugar.t0000644000175000017500000000300112240102127017553 0ustar rsrchboyrsrchboyuse strict; use warnings; { package TestClass; use Moose; } { package TestClass::NotCleaned; use Moose; no Moose; } use Test::Builder::Tester; # tests => 1; use Test::More; use Test::Moose::More; # not ok 1 - TestRole can has # not ok 2 - TestRole can around # not ok 3 - TestRole can augment # not ok 4 - TestRole can inner # not ok 5 - TestRole can before # not ok 6 - TestRole can after # not ok 7 - TestRole can blessed # not ok 8 - TestRole can confess # check for sugar in a class that still has it my $i; do { $i++; test_out "ok $i - TestClass can $_" } for Test::Moose::More::known_sugar(); check_sugar_ok 'TestClass'; test_test 'check_sugar_ok works correctly'; # check for sugar in a class that has none $i = 0; do { $i++; test_out "not ok $i - TestClass::NotCleaned can $_"; test_fail(2) } for Test::Moose::More::known_sugar(); check_sugar_ok 'TestClass::NotCleaned'; test_test 'check_sugar_ok works correctly on classes without sugar'; # check for no sugar in a class that still has it $i = 0; do { $i++; test_out "not ok $i - TestClass cannot $_"; test_fail(2) } for Test::Moose::More::known_sugar(); check_sugar_removed_ok 'TestClass'; test_test 'check_sugar_removed_ok works correctly with sugar'; # check for no sugar in a class that has none $i = 0; do { $i++; test_out "ok $i - TestClass::NotCleaned cannot $_" } for Test::Moose::More::known_sugar(); check_sugar_removed_ok 'TestClass::NotCleaned'; test_test 'check_sugar_removed_ok works correctly w/o sugar'; done_testing; Test-Moose-More-0.022/t/does_not_ok.t0000644000175000017500000000726212240102127017615 0ustar rsrchboyrsrchboyuse strict; use warnings; { package TestRole::Role; use Moose::Role; } { package TestRole::Role2; use Moose::Role; } { package TestRole::Fail; use Moose::Role; with 'TestRole::Role'; with 'TestRole::Role2'; } { package TestClass::Fail; use Moose; with 'TestRole::Role'; with 'TestRole::Role2'; } { package TestRole; use Moose::Role; } { package TestClass; use Moose; } { package TestRole::Fail2; use Moose::Role; with 'TestRole::Role'; } { package TestClass::Fail2; use Moose; with 'TestRole::Role'; } use Test::Builder::Tester; use Test::More; use Test::Moose::More; use TAP::SimpleOutput 'counters'; my $ROLE = 'TestRole::Role'; my @ROLES = qw{ TestRole::Role TestRole::Role2 }; note 'single role, default message - OK'; for my $thing (qw{ TestClass TestRole }) { my ($_ok, $_nok) = counters(); test_out $_ok->("$thing does not do $ROLE"); does_not_ok $thing, $ROLE; test_test "$thing is found to not do $ROLE correctly"; } note 'single role, custom message - OK'; for my $thing (qw{ TestClass TestRole }) { my ($_ok, $_nok) = counters(); test_out $_ok->('wah-wah'); does_not_ok $thing, $ROLE, 'wah-wah'; test_test "$thing: custom messages work as expected"; } note 'single role, "complex" custom message - OK'; for my $thing (qw{ TestClass TestRole }) { my ($_ok, $_nok) = counters(); test_out $_ok->("wah-wah $ROLE"); does_not_ok $thing, $ROLE, 'wah-wah %s'; test_test "$thing: 'complex' custom messages work as expected"; } note 'multiple roles, default message - OK'; for my $thing (qw{ TestClass TestRole }) { # role - OK my ($_ok, $_nok) = counters(); test_out $_ok->("$thing does not do $_") for @ROLES; does_not_ok $thing, [ @ROLES ]; test_test "$thing is found to not do the roles correctly"; } note 'multiple roles, custom message - OK'; for my $thing (qw{ TestClass TestRole }) { # role - OK my ($_ok, $_nok) = counters(); my $msg = 'wah-wah'; test_out $_ok->($msg) for @ROLES; does_not_ok $thing, [ @ROLES ], $msg; test_test "$thing: multiple roles, custom messages work as expected"; } note 'multiple roles, "complex" custom message - OK'; for my $thing (qw{ TestClass TestRole }) { # role - OK my ($_ok, $_nok) = counters(); my $msg = 'wah-wah'; test_out $_ok->("$msg $_") for @ROLES; does_not_ok $thing, [ @ROLES ], "$msg %s"; test_test "$thing: multiple roles, 'complex' custom messages work as expected"; } note 'role - NOT OK'; for my $thing (qw{ TestClass::Fail TestRole::Fail }) { # role - NOT OK my ($_ok, $_nok) = counters(); test_out $_nok->("$thing does not do $ROLE"); test_fail 1; does_not_ok $thing, $ROLE; test_test "$thing is found to not do $ROLE correctly"; } note 'multiple roles - NOT OK'; for my $thing (qw{ TestClass::Fail TestRole::Fail }) { # role - OK my ($_ok, $_nok) = counters(); do { test_out $_nok->("$thing does not do $_"); test_fail 1 } for @ROLES; does_not_ok $thing, [ @ROLES ]; test_test "$thing: multiple roles fail as expected"; } note 'multiple roles - PARTIALLY OK'; for my $thing (qw{ TestClass::Fail2 TestRole::Fail2 }) { # role - OK my ($_ok, $_nok) = counters(); do { test_out $_nok->("$thing does not do $_"); test_fail 2 } for $ROLES[0]; do { test_out $_ok->("$thing does not do $_") } for $ROLES[1]; does_not_ok $thing, [ @ROLES ]; test_test "$thing: multiple roles partially fail as expected"; } done_testing; Test-Moose-More-0.022/t/is_not_anon.t0000644000175000017500000000253512240102127017616 0ustar rsrchboyrsrchboyuse strict; use warnings; use Test::Builder::Tester; use Moose::Util 'with_traits'; use Test::More; use Test::Moose::More; use TAP::SimpleOutput 'counters'; { package TestRole; use Moose::Role; use namespace::autoclean; } { package TestClass; use Moose; } # initial tests, covering the most straight-forward cases (IMHO) my $anon_class = with_traits('TestClass' => 'TestRole'); my $anon_role = Moose::Meta::Role ->create_anon_role(weaken => 0) ->name ; note 'simple anon class'; { my ($_ok, $_nok, $_skip) = counters(); test_out $_nok->("$anon_class is not anonymous"); test_fail 1; is_not_anon $anon_class; test_test 'is_not_anon works correctly on anon class'; } note 'simple anon role'; { my ($_ok, $_nok, $_skip) = counters(); test_out $_nok->("$anon_role is not anonymous"); test_fail 1; is_not_anon $anon_role; test_test 'is_not_anon works correctly on anon role'; } note 'simple !anon class'; { my ($_ok, $_nok, $_skip) = counters(); test_out $_ok->('TestClass is not anonymous'); is_not_anon 'TestClass'; test_test 'is_not_anon works correctly on !anon class'; } note 'simple !anon role'; { my ($_ok, $_nok, $_skip) = counters(); test_out $_ok->('TestRole is not anonymous'); is_not_anon 'TestRole'; test_test 'is_not_anon works correctly on !anon role'; } done_testing; Test-Moose-More-0.022/t/release-eol.t0000644000175000017500000000047612240102127017507 0ustar rsrchboyrsrchboy BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; eval 'use Test::EOL'; plan skip_all => 'Test::EOL required' if $@; all_perl_files_ok({ trailing_whitespace => 1 }); Test-Moose-More-0.022/t/has_method_ok.t0000644000175000017500000000075312240102127020114 0ustar rsrchboyrsrchboyuse strict; use warnings; { package TestClass; use Moose; sub foo { } } use Test::Builder::Tester; use Test::More; use Test::Moose::More; test_out 'ok 1 - TestClass has method foo'; has_method_ok 'TestClass', 'foo'; test_test 'has_method_ok works correctly with methods'; # is_role vs plain-old-package test_out 'not ok 1 - TestClass has method bar'; test_fail(1); has_method_ok 'TestClass', 'bar'; test_test 'has_method_ok works correctly with DNE methods'; done_testing; Test-Moose-More-0.022/t/validate_role.t0000644000175000017500000000677612240102127020135 0ustar rsrchboyrsrchboyuse strict; use warnings; { package TestRole::One; use Moose::Role; } { package TestRole::Two; use Moose::Role; } { package TestRole::Invalid; use Moose::Role; with 'TestRole::Two'; } { package TestClass::NonMoosey; } { package TestRole; use Moose::Role; with 'TestRole::One'; has foo => (is => 'ro'); has baz => (traits => ['TestRole::Two'], is => 'ro'); sub method1 { } requires 'blargh'; has bar => ( traits => ['Array'], isa => 'ArrayRef', is => 'ro', lazy => 1, builder => '_build_bar', handles => { has_bar => 'count', num_bars => 'count', } ); } use Test::Builder::Tester; # tests => 1; use Test::More; use Test::Moose::More; use TAP::SimpleOutput 'counters'; note 'validate w/valid role'; { my ($_ok, $_nok) = counters(); test_out $_ok->('TestRole has a metaclass'); test_out $_ok->('TestRole is a Moose role'); test_out $_ok->('TestRole requires method blargh'); test_out $_ok->('TestRole does TestRole'); test_out $_ok->('TestRole does not do TestRole::Two'); test_out $_ok->("TestRole has method $_") for qw{ method1 }; test_out $_ok->('TestRole has an attribute named bar'); validate_role 'TestRole' => ( attributes => [ 'bar' ], does => [ 'TestRole' ], does_not => [ 'TestRole::Two' ], # XXX cannot check for accessor methods in a role at the moment #methods => [ qw{ foo method1 has_bar } ], methods => [ qw{ method1 } ], required_methods => [ qw{ blargh } ], ); test_test 'validate_role works correctly for valid roles'; } note 'validate w/non-moose package'; { my ($_ok, $_nok) = counters(); test_out $_nok->('TestClass::NonMoosey has a metaclass'); test_fail 1; validate_role 'TestClass::NonMoosey' => ( does => [ 'TestRole' ], methods => [ qw{ foo method1 has_bar } ], ); test_test 'validate_role works correctly for non-moose classes'; } note 'validate invalid role'; { my ($_ok, $_nok) = counters(); test_out $_ok->('TestRole::Invalid has a metaclass'); test_out $_ok->('TestRole::Invalid is a Moose role'); test_out $_nok->('TestRole::Invalid does TestRole'); test_fail 6; test_out $_nok->('TestRole::Invalid does not do TestRole::Two'); test_fail 4; do { test_out $_nok->("TestRole::Invalid has method $_"); test_fail 3 } for qw{ foo method1 has_bar }; validate_role 'TestRole::Invalid' => ( does => [ 'TestRole' ], does_not => [ 'TestRole::Two' ], methods => [ qw{ foo method1 has_bar } ], ); test_test 'validate_role works correctly for invalid roles'; } note 'validate w/attribute validation'; { my ($_ok, $_nok, $_skip) = counters(); test_out $_ok->('TestRole has a metaclass'); test_out $_ok->('TestRole is a Moose role'); test_out $_ok->('TestRole has an attribute named bar'); test_out $_ok->('TestRole has an attribute named baz'); test_out $_skip->(q{Cannot examine attribute metaclass in roles}); test_out $_ok->('TestRole has an attribute named foo'); validate_role 'TestRole' => ( attributes => [ 'bar', baz => { does => [ 'TestRole::Two' ] }, 'foo' ], ); test_test 'validate_role works correctly for attribute meta checking'; } done_testing; Test-Moose-More-0.022/t/00-check-deps.t0000644000175000017500000000043612240102127017531 0ustar rsrchboyrsrchboyuse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CheckDeps 0.010 use Test::More 0.94; use Test::CheckDeps 0.010; check_dependencies('suggests'); if (1) { BAIL_OUT("Missing dependencies") if !Test::More->builder->is_passing; } done_testing; Test-Moose-More-0.022/t/validate_class.t0000644000175000017500000001335012240102127020263 0ustar rsrchboyrsrchboyuse strict; use warnings; use Moose::Util 'with_traits'; { package TestRole; use Moose::Role; } { package TestRole::Two; use Moose::Role; } { package TestClass::Invalid; use Moose; with 'TestRole::Two'; } { package TestClass::NonMoosey; } { package TestClass; use Moose; with 'TestRole'; has foo => (is => 'ro'); has baz => (traits => ['TestRole::Two'], is => 'ro'); sub method1 { } has bar => ( traits => ['Array'], isa => 'ArrayRef', is => 'ro', lazy => 1, builder => '_build_bar', handles => { has_bar => 'count', num_bars => 'count', } ); } use Test::Builder::Tester; # tests => 1; use Test::More; use Test::Moose::More; use aliased 'Perl::Version' => 'PV'; use constant NEEDS_SUBTEST_HEADER => do { PV->new(Test::More->VERSION) >= PV->new('0.98_05') }; use TAP::SimpleOutput 0.002 'counters'; note 'validate w/valid class'; { my ($_ok, $_nok) = counters(); test_out $_ok->('TestClass has a metaclass'); test_out $_ok->('TestClass is a Moose class'); test_out $_ok->('TestClass isa Moose::Object'); test_out $_ok->('TestClass is not anonymous'); test_out $_ok->('TestClass does TestRole'); test_out $_ok->('TestClass does not do TestRole::Two'); test_out $_ok->("TestClass has method $_") for qw{ foo method1 has_bar }; test_out $_ok->('TestClass has an attribute named bar'); validate_class 'TestClass' => ( anonymous => 0, isa => [ 'Moose::Object' ], attributes => [ 'bar' ], does => [ 'TestRole' ], does_not => [ 'TestRole::Two' ], methods => [ qw{ foo method1 has_bar } ], ); test_test 'validate_class works correctly for valid classes'; } subtest 'validate w/valid class -- standalone run' => sub { validate_class 'TestClass' => ( anonymous => 0, isa => [ 'Moose::Object' ], attributes => [ 'bar' ], does => [ 'TestRole' ], does_not => [ 'TestRole::Two' ], methods => [ qw{ foo method1 has_bar } ], ); }; note 'simple validation w/anonymous_class'; { my $anon = with_traits 'TestClass' => 'TestRole::Two'; my ($_ok, $_nok) = counters(); test_out $_ok->("$anon has a metaclass"); test_out $_ok->("$anon is a Moose class"); test_out $_ok->("$anon is anonymous"); test_out $_ok->("$anon does TestRole::Two"); validate_class $anon => ( anonymous => 1, does => [ qw{ TestRole::Two } ], ); test_test 'simple validation w/anonymous_class'; } note 'simple is-anonymous validation w/anonymous_class'; { my $anon = with_traits 'TestClass' => 'TestRole::Two'; my ($_ok, $_nok) = counters(); test_out $_ok->("$anon has a metaclass"); test_out $_ok->("$anon is a Moose class"); test_out $_nok->("$anon is not anonymous"); test_fail 2; test_out $_ok->("$anon does TestRole::Two"); validate_class $anon => ( anonymous => 0, does => [ qw{ TestRole::Two } ], ); test_test 'simple not-anonymous validation w/anonymous_class'; } note 'validate w/non-moose package'; { my ($_ok, $_nok) = counters(); test_out $_nok->('TestClass::NonMoosey has a metaclass'); test_fail 1; validate_class 'TestClass::NonMoosey' => ( does => [ 'TestRole' ], methods => [ qw{ foo method1 has_bar } ], ); test_test 'validate_class works correctly for non-moose classes'; } note 'validate invalid class'; { my ($_ok, $_nok) = counters(); test_out $_ok->('TestClass::Invalid has a metaclass'); test_out $_ok->('TestClass::Invalid is a Moose class'); test_out $_nok->('TestClass::Invalid does TestRole'); test_fail 6; test_out $_nok->('TestClass::Invalid does not do TestRole::Two'); test_fail 4; do { test_out $_nok->("TestClass::Invalid has method $_"); test_fail 3 } for qw{ foo method1 has_bar }; validate_class 'TestClass::Invalid' => ( does => [ 'TestRole' ], does_not => [ 'TestRole::Two' ], methods => [ qw{ foo method1 has_bar } ], ); test_test 'validate_class works correctly for invalid classes'; } note 'validate w/attribute validation'; { my ($_ok, $_nok) = counters(); test_out $_ok->('TestClass has a metaclass'); test_out $_ok->('TestClass is a Moose class'); test_out $_ok->('TestClass has an attribute named bar'); test_out $_ok->('TestClass has an attribute named baz'); my $st_name = do { my ($_ok, $_nok, $_skip, $_plan, undef, $_any) = counters(1, my $name = q{[subtest] checking TestClass's attribute baz}); test_out $_any->("# Subtest: $name") if NEEDS_SUBTEST_HEADER; test_out $_ok->(q{Moose::Meta::Class::__ANON__::SERIAL::1 has a metaclass}); test_out $_ok->(q{Moose::Meta::Class::__ANON__::SERIAL::1 is a Moose class}); test_out $_ok->(q{TestClass's attribute baz does TestRole::Two}); test_out $_ok->(q{TestClass's attribute baz has a reader}); test_out $_ok->(q{TestClass's attribute baz option reader correct}); test_out $_plan->(); $name; }; test_out $_ok->($st_name); test_out $_ok->('TestClass has an attribute named foo'); validate_class 'TestClass' => ( attributes => [ 'bar', baz => { -does => [ 'TestRole::Two' ], reader => 'baz', }, 'foo', ], ); test_test 'validate_class works correctly for attribute meta checking'; } done_testing; Test-Moose-More-0.022/t/release-no-tabs.t0000644000175000017500000000060212240102127020262 0ustar rsrchboyrsrchboy BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::NoTabsTests 0.05 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/Test/Moose/More.pm' ); notabs_ok($_) foreach @files; done_testing; Test-Moose-More-0.022/t/has_attribute_ok.t0000644000175000017500000001053012240102127020631 0ustar rsrchboyrsrchboyuse strict; use warnings; { package TestRole; use Moose::Role; has foo => (is => 'ro'); } { package TestClass; use Moose; has foo => (is => 'ro'); } { package TestRole::Fail; use Moose::Role; with 'TestRole'; } { package TestClass::Fail; use Moose; with 'TestRole'; } { package TestClass::NotMoosey; } use Test::Builder::Tester; use Test::More; use Test::Moose::More; use Scalar::Util 'blessed'; use TAP::SimpleOutput 'counters'; my @THINGS = (TestClass->new(), qw{ TestClass TestRole }); my @FAILS = (qw{ TestClass::Fail TestRole::Fail }); note 'default message - OK'; for my $thing (@THINGS) { my $att = 'foo'; my $thing_name = blessed $thing || $thing; my ($_ok, $_nok) = counters(); test_out $_ok->("$thing_name has an attribute named $att"); has_attribute_ok $thing, $att; test_test "$thing is found to have attribute $att correctly"; } note 'custom message - OK'; for my $thing (@THINGS) { my $att = 'foo'; my $thing_name = blessed $thing || $thing; my ($_ok, $_nok) = counters(); test_out $_ok->('whee!'); has_attribute_ok $thing, $att, 'whee!'; test_test "$thing is found to have attribute $att correctly"; } note 'default message - NOK'; for my $thing (@FAILS) { my $att = 'bar'; my $thing_name = blessed $thing || $thing; my ($_ok, $_nok) = counters(); test_out $_nok->("$thing_name has an attribute named $att"); test_fail 1; has_attribute_ok $thing, $att; test_test "$thing is found to not have attribute $att correctly"; } note 'custom message - NOK'; for my $thing (@FAILS) { my $att = 'bar'; my $thing_name = blessed $thing || $thing; my ($_ok, $_nok) = counters(); test_out $_nok->('whee!'); test_fail 1; has_attribute_ok $thing, $att, 'whee!'; test_test "$thing is found to not have attribute $att correctly"; } done_testing; __END__ note 'single role, custom message - OK'; for my $thing (qw{ TestClass TestRole }) { my ($_ok, $_nok) = counters(); test_out $_ok->('wah-wah'); does_ok $thing, $ROLE, 'wah-wah'; test_test "$thing: custom messages work as expected"; } note 'single role, "complex" custom message - OK'; for my $thing (qw{ TestClass TestRole }) { my ($_ok, $_nok) = counters(); test_out $_ok->("wah-wah $ROLE"); does_ok $thing, $ROLE, 'wah-wah %s'; test_test "$thing: 'complex' custom messages work as expected"; } note 'multiple roles, default message - OK'; for my $thing (qw{ TestClass::Two TestRole::Two }) { # role - OK my ($_ok, $_nok) = counters(); test_out $_ok->("$thing does $_") for @ROLES; does_ok $thing, [ @ROLES ]; test_test "$thing is found to do the roles correctly"; } note 'multiple roles, custom message - OK'; for my $thing (qw{ TestClass::Two TestRole::Two }) { # role - OK my ($_ok, $_nok) = counters(); my $msg = 'wah-wah'; test_out $_ok->($msg) for @ROLES; does_ok $thing, [ @ROLES ], $msg; test_test "$thing: multiple roles, custom messages work as expected"; } note 'multiple roles, "complex" custom message - OK'; for my $thing (qw{ TestClass::Two TestRole::Two }) { # role - OK my ($_ok, $_nok) = counters(); my $msg = 'wah-wah'; test_out $_ok->("$msg $_") for @ROLES; does_ok $thing, [ @ROLES ], "$msg %s"; test_test "$thing: multiple roles, 'complex' custom messages work as expected"; } note 'role - NOT OK'; for my $thing (qw{ TestClass::Fail TestRole::Fail }) { # role - NOT OK my ($_ok, $_nok) = counters(); test_out $_nok->("$thing does $ROLE"); test_fail 1; does_ok $thing, $ROLE; test_test "$thing is found to not do $ROLE correctly"; } note 'multiple roles - NOT OK'; for my $thing (qw{ TestClass::Fail TestRole::Fail }) { # role - OK my ($_ok, $_nok) = counters(); do { test_out $_nok->("$thing does $_"); test_fail 1 } for @ROLES; does_ok $thing, [ @ROLES ]; test_test "$thing: multiple roles fail as expected"; } note 'multiple roles - PARTIALLY OK'; for my $thing (qw{ TestClass::Fail2 TestRole::Fail2 }) { # role - OK my ($_ok, $_nok) = counters(); do { test_out $_nok->("$thing does $_"); test_fail 2 } for $ROLES[0]; do { test_out $_ok->("$thing does $_") } for $ROLES[1]; does_ok $thing, [ @ROLES ]; test_test "$thing: multiple roles partially fail as expected"; } done_testing; Test-Moose-More-0.022/t/attribute/0000775000175000017500000000000012240102127017123 5ustar rsrchboyrsrchboyTest-Moose-More-0.022/t/attribute/coerce.t0000644000175000017500000000443212240102127020551 0ustar rsrchboyrsrchboyuse strict; use warnings; use Test::Builder::Tester; use Test::More; use Test::Moose::More; use TAP::SimpleOutput 'counters'; { package TestRole; use Moose::Role; use Moose::Deprecated -api_version => '1.07'; # don't complain use namespace::autoclean; has yes_coerce => (is => 'ro', isa => 'Str', coerce => 1); has no_coerce => (is => 'ro', isa => 'Str', coerce => 0); has null_coerce => (is => 'ro', isa => 'Str'); } { package TestClass; use Moose; use Moose::Deprecated -api_version => '1.07'; # don't complain use namespace::autoclean; has yes_coerce => (is => 'ro', isa => 'Str', coerce => 1); has no_coerce => (is => 'ro', isa => 'Str', coerce => 0); has null_coerce => (is => 'ro', isa => 'Str'); } note 'finds coercion correctly'; for my $thing (qw{ TestClass TestRole }) { my ($_ok, $_nok, $_skip) = counters(); my $name = 'yes_coerce'; test_out $_ok->("$thing has an attribute named $name"); test_out $_ok->("$name should coerce"); test_out $_ok->("$thing has an attribute named $name"); test_out $_nok->("$name should not coerce"); test_fail 7; test_out $_ok->("$thing has an attribute named $name"); test_out $_nok->("$name should not coerce"); test_fail 7; validate_attribute $thing => $name => ( coerce => 1, ); validate_attribute $thing => $name => ( coerce => 0, ); validate_attribute $thing => $name => ( coerce => undef, ); test_test "finds coercion correctly in $thing"; } note 'finds no coercion correctly'; for my $thing (qw{ TestClass TestRole}) { my ($_ok, $_nok, $_skip) = counters(); my $name = 'no_coerce'; test_out $_ok->("$thing has an attribute named $name"); test_out $_nok->("$name should coerce"); test_fail 5; test_out $_ok->("$thing has an attribute named $name"); test_out $_ok->("$name should not coerce"); test_out $_ok->("$thing has an attribute named $name"); test_out $_ok->("$name should not coerce"); validate_attribute $thing => $name => ( coerce => 1, ); validate_attribute $thing => $name => ( coerce => 0, ); validate_attribute $thing => $name => ( coerce => undef, ); test_test "finds no coercion correctly in $thing"; } done_testing; Test-Moose-More-0.022/t/author-pod-spell.t0000644000175000017500000000102412240102127020477 0ustar rsrchboyrsrchboy BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006001 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ AFAICT ABEND RSRCHBOY RSRCHBOY's gpg ini metaclass metaclasses parameterized parameterization subclasses coderef Chris Weyl cweyl lib Test Moose More Test-Moose-More-0.022/t/requires_method_ok.t0000644000175000017500000000104412240102127021172 0ustar rsrchboyrsrchboyuse strict; use warnings; { package TestRole; use Moose::Role; requires 'foo'; } use Test::Builder::Tester; use Test::More; use Test::Moose::More; my $THING = 'TestRole'; test_out "ok 1 - $THING requires method foo"; requires_method_ok $THING, 'foo'; test_test 'requires_method_ok works correctly with methods'; # is_role vs plain-old-package test_out "not ok 1 - $THING requires method bar"; test_fail(1); requires_method_ok $THING, 'bar'; test_test 'requires_method_ok works correctly with methods not required'; done_testing; Test-Moose-More-0.022/t/validate_attribute.t0000644000175000017500000001141212240102127021156 0ustar rsrchboyrsrchboyuse strict; use warnings; use Test::Builder::Tester; use Test::More; use Test::Moose::More; use TAP::SimpleOutput 0.002 'counters'; { package TestRole; use Moose::Role; use namespace::autoclean; has thinger => (is => 'ro', predicate => 'has_thinger'); } { package TestClass; use Moose; use namespace::autoclean; has foo => ( traits => [ 'TestRole' ], required => 1, is => 'ro', isa => 'Int', builder => '_build_foo', lazy => 1, thinger => 'foo', ); } # initial tests, covering the most straight-forward cases (IMHO) note 'validate attribute validation'; { my ($_ok, $_nok, $_skip) = counters(); test_out $_ok->('TestClass has an attribute named foo'); test_out $_ok->(q{Moose::Meta::Class::__ANON__::SERIAL::1 has a metaclass}); test_out $_ok->(q{Moose::Meta::Class::__ANON__::SERIAL::1 is a Moose class}); test_out $_ok->('Moose::Meta::Class::__ANON__::SERIAL::1 isa Moose::Meta::Attribute'); test_out $_ok->('Moose::Meta::Class::__ANON__::SERIAL::1 does TestRole'); test_out $_ok->('foo is required'); test_out $_ok->('foo has a builder'); test_out $_ok->('foo option builder correct'); test_out $_ok->('foo does not have a default'); test_out $_ok->('foo option default correct'); test_out $_ok->('foo has a reader'); test_out $_ok->('foo option reader correct'); test_out $_skip->("cannot test 'isa' options yet"); test_out $_skip->("cannot test 'does' options yet"); test_out $_skip->("cannot test 'handles' options yet"); test_out $_skip->("cannot test 'traits' options yet"); test_out $_ok->('foo has a init_arg'); test_out $_ok->('foo option init_arg correct'); test_out $_ok->('foo is lazy'); test_out $_nok->('unknown attribute option: binger'); test_fail 3; test_out $_ok->('foo has a thinger'); test_out $_ok->('foo option thinger correct'); validate_attribute TestClass => foo => ( -does => [ 'TestRole' ], -isa => [ 'Moose::Meta::Attribute' ], traits => [ 'TestRole' ], isa => 'Int', does => 'Bar', handles => { }, reader => 'foo', builder => '_build_foo', default => undef, init_arg => 'foo', lazy => 1, required => 1, thinger => 'foo', binger => 'bar', ); test_test 'validate_attribute works correctly'; } subtest 'a standalone run of validate_attribute' => sub { note 'of necessity, these exclude the "failing" tests'; validate_attribute TestClass => foo => ( -does => [ 'TestRole' ], -isa => [ 'Moose::Meta::Attribute' ], traits => [ 'TestRole' ], isa => 'Int', does => 'Bar', handles => { }, reader => 'foo', builder => '_build_foo', default => undef, init_arg => 'foo', required => 1, lazy => 1, thinger => 'foo', ); }; note 'attribute_options_ok validation'; { my ($_ok, $_nok, $_skip) = counters(); test_out $_ok->('TestClass has an attribute named foo'); test_out $_ok->('foo has a builder'); test_out $_ok->('foo option builder correct'); test_out $_ok->('foo does not have a default'); test_out $_ok->('foo option default correct'); test_out $_ok->('foo has a reader'); test_out $_ok->('foo option reader correct'); test_out $_skip->("cannot test 'isa' options yet"); test_out $_skip->("cannot test 'does' options yet"); test_out $_skip->("cannot test 'handles' options yet"); test_out $_skip->("cannot test 'traits' options yet"); test_out $_ok->('foo has a init_arg'); test_out $_ok->('foo option init_arg correct'); test_out $_ok->('foo is lazy'); test_out $_nok->('unknown attribute option: binger'); test_fail 3; test_out $_ok->('foo has a thinger'); test_out $_ok->('foo option thinger correct'); attribute_options_ok TestClass => foo => ( traits => [ 'TestRole' ], isa => 'Int', does => 'Bar', handles => { }, reader => 'foo', builder => '_build_foo', default => undef, init_arg => 'foo', lazy => 1, thinger => 'foo', binger => 'bar', ); test_test 'attribute_options_ok works as expected'; } subtest 'a standalone run of attribute_options_ok' => sub { note 'of necessity, these exclude the "failing" tests'; attribute_options_ok TestClass => foo => ( traits => [ 'TestRole' ], isa => 'Int', does => 'Bar', handles => { }, reader => 'foo', builder => '_build_foo', default => undef, init_arg => 'foo', lazy => 1, ); }; done_testing; Test-Moose-More-0.022/t/release-pod-syntax.t0000644000175000017500000000077512240102127021040 0ustar rsrchboyrsrchboy#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # # This file is part of Test-Moose-More # # 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 # use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); Test-Moose-More-0.022/t/release-has-version.t0000644000175000017500000000102012240102127021150 0ustar rsrchboyrsrchboy#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # # This file is part of Test-Moose-More # # 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 # use Test::More; eval "use Test::HasVersion"; plan skip_all => "Test::HasVersion required for testing version numbers" if $@; all_pm_version_ok(); Test-Moose-More-0.022/t/release-pod-coverage.t0000644000175000017500000000131212240102127021271 0ustar rsrchboyrsrchboy#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # # This file is part of Test-Moose-More # # 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 # use Test::More; eval "use Test::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Test-Moose-More-0.022/t/release-pod-linkcheck.t0000644000175000017500000000132212240102127021432 0ustar rsrchboyrsrchboy#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # # This file is part of Test-Moose-More # # 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 # use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_LINKCHECK ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::LinkCheck"; if ( $@ ) { plan skip_all => 'Test::Pod::LinkCheck required for testing POD'; } else { Test::Pod::LinkCheck->new->all_pod_ok; } Test-Moose-More-0.022/t/release-minimum-version.t0000644000175000017500000000105412240102127022057 0ustar rsrchboyrsrchboy#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # # This file is part of Test-Moose-More # # 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 # use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_ok( qq{5.008008} ); Test-Moose-More-0.022/t/000-report-versions-tiny.t0000644000175000017500000000623312240102127021746 0ustar rsrchboyrsrchboyuse strict; use warnings; use Test::More 0.88; # This is a relatively nice way to avoid Test::NoWarnings breaking our # expectations by adding extra tests, without using no_plan. It also helps # avoid any other test module that feels introducing random tests, or even # test plans, is a nice idea. our $success = 0; END { $success && done_testing; } # List our own version used to generate this my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10\n"; eval { # no excuses! # report our Perl details my $want = '5.006'; $v .= "perl: $] (wanted $want) on $^O from $^X\n\n"; }; defined($@) and diag("$@"); # Now, our module version dependencies: sub pmver { my ($module, $wanted) = @_; $wanted = " (want $wanted)"; my $pmver; eval "require $module;"; if ($@) { if ($@ =~ m/Can't locate .* in \@INC/) { $pmver = 'module not found.'; } else { diag("${module}: $@"); $pmver = 'died during require.'; } } else { my $version; eval { $version = $module->VERSION; }; if ($@) { diag("${module}: $@"); $pmver = 'died during VERSION check.'; } elsif (defined $version) { $pmver = "$version"; } else { $pmver = ''; } } # So, we should be good, right? return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n"); } eval { $v .= pmver('Class::MOP','any version') }; eval { $v .= pmver('Data::OptList','any version') }; eval { $v .= pmver('ExtUtils::MakeMaker','6.30') }; eval { $v .= pmver('File::Spec','any version') }; eval { $v .= pmver('IO::Handle','any version') }; eval { $v .= pmver('IPC::Open3','any version') }; eval { $v .= pmver('Moose','any version') }; eval { $v .= pmver('Moose::Autobox','any version') }; eval { $v .= pmver('Moose::Role','any version') }; eval { $v .= pmver('Moose::Util','any version') }; eval { $v .= pmver('Moose::Util::TypeConstraints','any version') }; eval { $v .= pmver('Perl::Version','any version') }; eval { $v .= pmver('Scalar::Util','any version') }; eval { $v .= pmver('Sub::Exporter','any version') }; eval { $v .= pmver('Syntax::Keyword::Junction','any version') }; eval { $v .= pmver('TAP::SimpleOutput','0.002') }; eval { $v .= pmver('Test::Builder','any version') }; eval { $v .= pmver('Test::Builder::Tester','any version') }; eval { $v .= pmver('Test::CheckDeps','0.010') }; eval { $v .= pmver('Test::Moose','any version') }; eval { $v .= pmver('Test::More','0.94') }; eval { $v .= pmver('aliased','any version') }; eval { $v .= pmver('constant','any version') }; eval { $v .= pmver('namespace::autoclean','any version') }; eval { $v .= pmver('strict','any version') }; eval { $v .= pmver('warnings','any version') }; # All done. $v .= <<'EOT'; Thanks for using my code. I hope it works for you. If not, please try and include this output in the bug report. That will help me reproduce the issue and solve your problem. EOT diag($v); ok(1, "we really didn't test anything, just reporting data"); $success = 1; # Work around another nasty module on CPAN. :/ no warnings 'once'; $Template::Test::NO_FLUSH = 1; exit 0; Test-Moose-More-0.022/t/release-no-smart-comments.t0000644000175000017500000000113612240102127022305 0ustar rsrchboyrsrchboy#!/usr/bin/env perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # # This file is part of Test-Moose-More # # 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 # use strict; use warnings; use Test::More 0.88; eval "use Test::NoSmartComments"; plan skip_all => 'Test::NoSmartComments required for checking comment IQ' if $@; no_smart_comments_in_all(); done_testing(); Test-Moose-More-0.022/t/release-consistent-version.t0000644000175000017500000000056212240102127022600 0ustar rsrchboyrsrchboy BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; eval "use Test::ConsistentVersion"; plan skip_all => "Test::ConsistentVersion required for this test" if $@; Test::ConsistentVersion::check_consistent_versions(); Test-Moose-More-0.022/.travis.yml0000644000175000017500000000071012240102127016762 0ustar rsrchboyrsrchboylanguage: perl perl: - "5.8" - "5.10" - "5.12" - "5.14" - "5.16" - "5.18" matrix: allow_failures: - perl: "5.8" before_install: # git bits sometimes needed... - git config user.name 'Travis-CI' - git config user.email 'travis@nowhere.dne' install: # not so much install our package as all its prereqs - cpanm --installdeps . || { cat ~/.cpanm/build.log ; false ; } script: - perl Makefile.PL - make test Test-Moose-More-0.022/Makefile.PL0000644000175000017500000000421012240102127016622 0ustar rsrchboyrsrchboy use strict; use warnings; use 5.006; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "More tools for testing Moose packages", "AUTHOR" => "Chris Weyl ", "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "Test-Moose-More", "EXE_FILES" => [], "LICENSE" => "lgpl", "NAME" => "Test::Moose::More", "PREREQ_PM" => { "Data::OptList" => 0, "Moose::Autobox" => 0, "Moose::Util" => 0, "Moose::Util::TypeConstraints" => 0, "Scalar::Util" => 0, "Sub::Exporter" => 0, "Syntax::Keyword::Junction" => 0, "Test::Builder" => 0, "Test::Moose" => 0, "Test::More" => "0.94", "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Moose" => 0, "Moose::Role" => 0, "Perl::Version" => 0, "TAP::SimpleOutput" => "0.002", "Test::Builder::Tester" => 0, "Test::CheckDeps" => "0.010", "Test::More" => "0.94", "aliased" => 0, "constant" => 0, "namespace::autoclean" => 0 }, "VERSION" => "0.022", "test" => { "TESTS" => "t/*.t t/attribute/*.t" } ); my %FallbackPrereqs = ( "Data::OptList" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Moose" => 0, "Moose::Autobox" => 0, "Moose::Role" => 0, "Moose::Util" => 0, "Moose::Util::TypeConstraints" => 0, "Perl::Version" => 0, "Scalar::Util" => 0, "Sub::Exporter" => 0, "Syntax::Keyword::Junction" => 0, "TAP::SimpleOutput" => "0.002", "Test::Builder" => 0, "Test::Builder::Tester" => 0, "Test::CheckDeps" => "0.010", "Test::Moose" => 0, "Test::More" => "0.94", "aliased" => 0, "constant" => 0, "namespace::autoclean" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Test-Moose-More-0.022/lib/0000775000175000017500000000000012240102127015423 5ustar rsrchboyrsrchboyTest-Moose-More-0.022/lib/Test/0000775000175000017500000000000012240102127016342 5ustar rsrchboyrsrchboyTest-Moose-More-0.022/lib/Test/Moose/0000775000175000017500000000000012240102127017424 5ustar rsrchboyrsrchboyTest-Moose-More-0.022/lib/Test/Moose/More.pm0000644000175000017500000003654512240102127020677 0ustar rsrchboyrsrchboy# # This file is part of Test-Moose-More # # 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 # package Test::Moose::More; BEGIN { $Test::Moose::More::AUTHORITY = 'cpan:RSRCHBOY'; } { $Test::Moose::More::VERSION = '0.022'; } # git description: 0.021-1-gad34934 # ABSTRACT: More tools for testing Moose packages use strict; use warnings; use Sub::Exporter -setup => { exports => [ qw{ is_role is_class is_anon is_not_anon has_method_ok requires_method_ok check_sugar_ok check_sugar_removed_ok has_attribute_ok attribute_options_ok validate_attribute validate_class validate_role meta_ok does_ok does_not_ok with_immutable } ], groups => { default => [ ':all' ] }, }; use Test::Builder; use Test::More; use Test::Moose 'with_immutable'; use Scalar::Util 'blessed'; use Syntax::Keyword::Junction 'any'; use Moose::Autobox; use Moose::Util 'does_role', 'find_meta'; use Moose::Util::TypeConstraints; use Data::OptList; # debugging... #use Smart::Comments; my $tb = Test::Builder->new(); our $THING_NAME; sub _thing_name { my ($thing, $thing_meta) = @_; return $THING_NAME if $THING_NAME; $thing_meta ||= find_meta($thing); # try very hard to come up with a meaningful name my $desc = !!$thing_meta ? $thing_meta->name : blessed $thing ? ref $thing : ref $thing ? 'The object' : $thing ; return $desc; } sub meta_ok ($;$) { my ($thing, $message) = @_; my $thing_meta = find_meta($thing); $message ||= _thing_name($thing, $thing_meta) . ' has a meta'; return $tb->ok(!!$thing_meta, $message); } sub does_ok { my ($thing, $roles, $message) = @_; my $thing_meta = find_meta($thing); $roles = [ $roles ] unless ref $roles; $message ||= _thing_name($thing, $thing_meta) . ' does %s'; $tb->ok(!!$thing_meta->does_role($_), sprintf($message, $_)) for @$roles; return; } sub does_not_ok { my ($thing, $roles, $message) = @_; my $thing_meta = find_meta($thing); $roles = [ $roles ] unless ref $roles; $message ||= _thing_name($thing, $thing_meta) . ' does not do %s'; $tb->ok(!$thing_meta->does_role($_), sprintf($message, $_)) for @$roles; return; } sub has_attribute_ok ($$;$) { my ($thing, $attr_name, $message) = @_; my $meta = find_meta($thing); my $thing_name = $meta->name; $message ||= "$thing_name has an attribute named $attr_name"; return $tb->ok(($meta->has_attribute($attr_name) ? 1 : 0), $message) if $meta->isa('Moose::Meta::Role'); return $tb->ok(1, $message) if $meta->find_attribute_by_name($attr_name); return $tb->ok(0, $message); } sub has_method_ok { my ($thing, @methods) = @_; ### $thing my $meta = find_meta($thing); my $name = $meta->name; ### @methods $tb->ok(!!$meta->has_method($_), "$name has method $_") for @methods; return; } sub requires_method_ok { my ($thing, @methods) = @_; ### $thing my $meta = find_meta($thing); my $name = $meta->name; ### @methods $tb->ok(!!$meta->requires_method($_), "$name requires method $_") for @methods; return; } sub is_role { unshift @_, 'Role'; goto \&_is_moosey } sub is_class { unshift @_, 'Class'; goto \&_is_moosey } sub _is_moosey { my ($type, $thing) = @_; my $thing_name = ref $thing || $thing; my $meta = find_meta($thing); $tb->ok(!!$meta, "$thing_name has a metaclass"); return unless !!$meta; return $tb->ok($meta->isa("Moose::Meta::$type"), "$thing_name is a Moose " . lc $type); } sub is_anon { my ($thing, $message) = @_; my $thing_meta = find_meta($thing); $message ||= _thing_name($thing, $thing_meta) . ' is anonymous'; return $tb->ok(!!$thing_meta->is_anon, $message); } sub is_not_anon { my ($thing, $message) = @_; my $thing_meta = find_meta($thing); $message ||= _thing_name($thing, $thing_meta) . ' is not anonymous'; return $tb->ok(!$thing_meta->is_anon, $message); } sub known_sugar { qw{ has around augment inner before after blessed confess } } sub check_sugar_removed_ok { my $t = shift @_; # check some (not all) Moose sugar to make sure it has been cleared $tb->ok(!$t->can($_) => "$t cannot $_") for known_sugar; return; } sub check_sugar_ok { my $t = shift @_; # check some (not all) Moose sugar to make sure it has been cleared $tb->ok($t->can($_) => "$t can $_") for known_sugar; return; } sub validate_thing { my ($thing, %args) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; ### anonymous... $args{anonymous} ? is_anon $thing : is_not_anon $thing if exists $args{anonymous}; ### roles... do { does_ok($thing, $_) for @{$args{does}} } if exists $args{does}; do { does_not_ok($thing, $_) for @{$args{does_not}} } if exists $args{does_not}; ### methods... do { has_method_ok($thing, $_) for @{$args{methods}} } if exists $args{methods}; ### attributes... ATTRIBUTE_LOOP: for my $attribute (@{Data::OptList::mkopt($args{attributes} || [])}) { my ($name, $opts) = @$attribute; has_attribute_ok($thing, $name); if ($opts) { SKIP: { skip 'Cannot examine attribute metaclass in roles', 1 if (find_meta($thing)->isa('Moose::Meta::Role')); local $THING_NAME = "${thing}'s attribute $name"; $tb->subtest("[subtest] checking $THING_NAME" => sub { _validate_attribute(find_meta($thing)->get_attribute($name), %$opts); }); } } } return; } sub validate_class { my ($class, %args) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; return unless is_class $class; my $name = ref $class || $class; do { ok($class->isa($_), "$name isa $_") for @{$args{isa}} } if exists $args{isa}; return validate_thing $class => %args; } sub validate_role { my ($role, %args) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; return unless is_role $role; requires_method_ok($role => @{ $args{required_methods} }) if defined $args{required_methods}; return validate_thing $role => %args; } sub validate_attribute { my ($thing, $name, %opts) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; has_attribute_ok($thing, $name); my $att = find_meta($thing)->get_attribute($name) or return; return _validate_attribute($att, %opts); } sub _validate_attribute { my ($att, %opts) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; my %thing_opts = map { $_ => delete $opts{"-$_"} } map { s/^-//; $_ } grep { /^-/ } sort keys %opts ; ### %thing_opts validate_class $att => %thing_opts if keys %thing_opts; return _attribute_options_ok($att, %opts); } sub attribute_options_ok { my ($thing, $name, %opts) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; has_attribute_ok($thing, $name); my $att = find_meta($thing)->get_attribute($name) or return; return _attribute_options_ok($att, %opts); } sub _attribute_options_ok { my ($att, %opts) = @_; my @check_opts = qw{ reader writer accessor predicate default builder clearer }; my @unhandled_opts = qw{ isa does handles traits }; local $Test::Builder::Level = $Test::Builder::Level + 1; my $name = $att->name; my $thing_name = _thing_name($name, $att); # XXX do we really want to do this? if (my $is = delete $opts{is}) { $opts{accessor} = $name if $is eq 'rw' && ! exists $opts{accessor}; $opts{reader} = $name if $is eq 'ro' && ! exists $opts{reader}; } my $check = sub { my $property = shift || $_; my $value = delete $opts{$property}; my $has = "has_$property"; defined $value ? ok($att->$has, "$thing_name has a $property") : ok(!$att->$has, "$thing_name does not have a $property") ; is($att->$property, $value, "$thing_name option $property correct") }; if (my $is_required = delete $opts{required}) { $is_required ? ok($att->is_required, "$thing_name is required") : ok(!$att->is_required, "$thing_name is not required") ; } $check->($_) for grep { any(@check_opts) eq $_ } sort keys %opts; do { $tb->skip("cannot test '$_' options yet", 1); delete $opts{$_} } for grep { exists $opts{$_} } @unhandled_opts; if (exists $opts{init_arg}) { $opts{init_arg} ? $check->('init_arg') : ok(!$att->has_init_arg, "$thing_name has no init_arg") ; delete $opts{init_arg}; } if (exists $opts{lazy}) { delete $opts{lazy} ? ok($att->is_lazy, "$thing_name is lazy") : ok(!$att->is_lazy, "$thing_name is not lazy") ; } if (exists $opts{coerce}) { delete $opts{coerce} ? ok( $att->should_coerce, "$thing_name should coerce") : ok(!$att->should_coerce, "$thing_name should not coerce") ; } for my $opt (sort keys %opts) { do { fail "unknown attribute option: $opt"; next } unless $att->meta->find_attribute_by_name($opt); $check->($opt); } #fail "unknown attribute option: $_" #for sort keys %opts; return; } 1; !!42; __END__ =pod =encoding UTF-8 =for :stopwords Chris Weyl =head1 NAME Test::Moose::More - More tools for testing Moose packages =head1 VERSION This document describes version 0.022 of Test::Moose::More - released November 10, 2013 as part of Test-Moose-More. =head1 SYNOPSIS use Test::Moose::More; is_class 'Some::Class'; is_role 'Some::Role'; has_method_ok 'Some::Class', 'foo'; # ... etc =head1 DESCRIPTION This package contains a number of additional tests that can be employed against Moose classes/roles. It is intended to replace L in your tests, and re-exports any tests that it has and we do not, yet. =head1 FUNCTIONS =head2 known_sugar Returns a list of all the known standard Moose sugar (has, extends, etc). =head1 TEST_FUNCTIONS =head2 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. =head2 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 C<%s> somewhere; this will be replaced with the name of the role being tested for. =head2 does_not_ok $thing, < $role | \@roles >, [ $message ] 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 C<%s> somewhere; this will be replaced with the name of the role being tested for. =head2 has_attribute_ok $thing, $attribute_name, [ $message ] Checks C<$thing> for an attribute named C<$attribute_name>; C<$thing> may be a class name, instance, or role name. =head2 has_method_ok $thing, @methods Queries $thing's metaclass to see if $thing has the methods named in @methods. =head2 requires_method_ok $thing, @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. =head2 is_role $thing Passes if $thing's metaclass is a L. =head2 is_class $thing Passes if $thing's metaclass is a L. =head2 is_anon $thing Passes if $thing is "anonymous". =head2 is_not_anon $thing Passes if $thing is not "anonymous". =head2 check_sugar_removed_ok $thing Ensures that all the standard Moose sugar is no longer directly callable on a given package. =head2 check_sugar_ok $thing Checks and makes sure a class/etc can still do all the standard Moose sugar. =head2 validate_thing Runs a bunch of tests against the given C<$thing>, as defined: validate_class $thing => ( attributes => [ ... ], methods => [ ... ], isa => [ ... ], # ensures $thing does these roles does => [ ... ], # ensures $thing does not do these roles does_not => [ ... ], ); C<$thing> can be the name of a role or class, an object instance, or a metaclass. =head2 validate_role The same as validate_thing(), but ensures C<$thing> is a role, and allows for additional role-specific tests. validate_role $thing => ( required_methods => [ ... ], # ...and all other options from validate_thing() =head2 validate_class The same as validate_thing(), but ensures C<$thing> is a class, and allows for additional class-specific tests. =head2 validate_attribute validate_attribute() allows you to test how an attribute looks once built and attached to a class. Let's say you have an attribute defined like this: has foo => ( traits => [ 'TestRole' ], is => 'ro', isa => 'Int', builder => '_build_foo', lazy => 1, ); You can use validate_attribute() to ensure that it's built out in the way you expect: validate_attribute TestClass => foo => ( -does => [ 'TestRole' ], -isa => [ 'Moose::Meta::Attribute' ], # for demonstration's sake traits => [ 'TestRole' ], isa => 'Int', does => 'Bar', handles => { }, reader => 'foo', builder => '_build_foo', default => undef, init_arg => 'foo', lazy => 1, required => undef, ); Not yet documented or tested exhaustively; please see t/validate_attribute.t for details at the moment. This test routine is likely to change in implementation and scope, with every effort to maintain backwards compatibility. =head2 attribute_options_ok Validates that an attribute is set up as expected; like validate_attribute(), but only concerns itself with attribute options. Not yet documented or tested exhaustively; please see t/validate_attribute.t for details at the moment. This test routine is likely to change in implementation and scope, with every effort to maintain backwards compatibility. =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =back =head1 SOURCE The development version is on github at L and may be cloned from L =head1 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. =head1 AUTHOR Chris Weyl =head1 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 =cut