Test-Routine-0.032 000755 000765 000024 0 15154420551 13306 5 ustar 00rjbs staff 000000 000000 README 100644 000765 000024 555 15154420551 14234 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032 This archive contains the distribution Test-Routine,
version 0.032:
composable units of assertion
This software is copyright (c) 2010 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
This README file was generated by Dist::Zilla::Plugin::Readme v6.037.
Changes 100644 000765 000024 13720 15154420551 14705 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032 Revision history for Test-Routine
0.032 2026-03-11 22:13:59-04:00 America/New_York
- add Test::Routine::Runner::NoSubtest, to run all the tests on an
instance without putting them into a subtest
0.031 2023-04-11 21:37:45-04:00 America/New_York
- The run_test method now returns the pass/fail of the subtest
represented by a test method. Since run_test is often around-ed, you
may need to adjust how you modify its return!
Thanks, Matthew Horsfall.
0.030 2023-01-05 19:03:17-05:00 America/New_York
- this version of Test-Routine now requires Perl v5.12 (but its prereqs
already did)
- remove the run_* exports from Test::Routine::Runner, as foretold in
the year 2010
0.029 2022-12-31 19:35:50-05:00 America/New_York
- update author contact info
0.028 2021-06-18 21:32:22-04:00 America/New_York
- update author contact info
- add perl-support clause
0.027 2018-08-26 21:40:35-04:00 America/New_York
- no changes since 0.026
0.026 2018-07-15 12:14:57-04:00 America/Toronto (TRIAL RELEASE)
- add test_routine_test_traits method to apply more traits to test
objects
- add skip_reason to test objects to allow them to say "skip me on this
run"
- drop use of undocumented "with_caller" feature from Moose::Exporter
0.025 2017-04-13 17:43:19-04:00 America/New_York
- remove fresh_instance; it wasn't documented, and it probably was not
going to work out
- the Runner no longer caches the test_instance, so its BUILD and
DEMOLISH should now be called usefully
- Test::Routine::Common now adds stub BUILD and DEMOLISH so you can use
method modifiers on them
0.024 2017-01-16 13:03:18-05:00 America/New_York
- tests are now run with Test::Abortable's subtest() instead of
Test2::API directly; this means they can be safely aborted with
exceptions that conform to the Test::Abortable rules; see its docs
for more information
0.023 2016-11-28 17:41:32+11:00 Australia/Melbourne
- When running subtests, use Test2::API rather than Test::More.
This means that Test::Routine tests that never use Test::Builder for
their own testing won't load it at all, but it also means that you'll
need to be on a pretty recent Test-Simple distribution.
- (no code changes from 0.022, just a non-trial release)
0.022 2016-07-18 20:13:38-04:00 America/New_York (TRIAL RELEASE)
- fix the mxms.t tests for Test2 changes (really, we should update the
tests to use an event-intercepting hub for our tests)
0.021 2016-07-18 12:45:57-04:00 America/New_York (TRIAL RELEASE)
- When running subtests, use Test2::API rather than Test::More.
This means that Test::Routine tests that never use Test::Builder for
their own testing won't load it at all, but it also means that you'll
need to be on a pretty recent Test-Simple distribution.
0.020 2014-09-01 22:02:27-04:00 America/New_York
- generation of Test::Routine::Manual::Demo is fixed
- notice another possible case of name conflict; we may change how this
works in the future, but only safely
0.019 2014-07-04 09:54:01-04:00 America/New_York
- cope with alternate indenting of subtest leader
0.018 2014-01-11 14:13:19-05:00 America/New_York
- avoid an uninitialized warning on 5.8 from new TEST_METHOD code
0.017 2013-12-03 21:38:07 America/New_York
- add TEST_METHOD env var to limit tests run (thanks,
Dagfinn Ilmari Mannsåker!)
0.016 2013-10-25 22:33:15 America/New_York
update mxms.t to handle Test::Builder 0.99
replace use of Class::MOP::load_class with Class::Load
0.015 2012-03-16 16:37:21 America/New_York
correct run_me to work with a single hashref argument
0.014 2011-09-11 08:47:21 America/New_York
fix a nit in the SYNOPSIS: the runner is run_me not test_me (thanks,
Alex White!)
0.013 2011-09-08 16:46:01 America/New_York
MooseX::Method::Signatures is not a prereq, it's optionally used in
some tests; the dist prereqs have been corrected to reflect this
0.012 2011-06-01 22:09:50 America/New_York
reject test names that conflict with Moose::Object methods
0.011 2011-05-31 10:49:59 America/New_York
install tests with package separators in their name under munged
names (bug reported by Piers Cawley)
0.010 2011-04-07 23:06:32 America/New_York
interoperate with MooseX::Method::Signatures (thanks, Jesse Luehrs)
0.009 2011-02-06 21:24:22 America/New_York
eliminate the 5.12-only ... operator
0.008 2011-02-03 21:02:08 America/New_York
eliminate a bogus prereq; sorry about that; thanks Glenn Fowler
0.007 2011-02-03 16:21:44 America/New_York
We now forbid two tests with the same name. This may seem to be
backwards incompatible, but the previous behavior was to silently
replace each test in turn, so that tests written would simply not
run. To allow safer routine composition, we have made duplicate
names fatal, rather than adding arbitrary distinguishing suffixes.
0.006 2011-01-26 15:27:00 America/New_York
correctly generate the Demo.pod (thanks, Yanick Champoux)
0.005 2010-12-19 21:53:36 America/New_York
tiny but critical bug in synopsis (thanks, Piers Cawley)
0.004 2010-10-27 19:46:19 America/New_York
correct a bug in test execution order
0.003 2010-10-18 23:02:32 America/New_York
PLEASE UPDATE YOUR CODE: run_* now come from Test::Runner::Util
0.002 2010-09-30 09:26:43 America/New_York
lower required perl to 5.8.x
raise required Test::More to 0.96
0.001 2010-09-29 11:25:57 America/New_York
first release
LICENSE 100644 000765 000024 46307 15154420551 14426 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032 This software is copyright (c) 2010 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Terms of the Perl programming language system itself
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
later version, or
b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
This software is Copyright (c) 2010 by Ricardo Signes.
This is free software, licensed under:
The GNU General Public License, Version 1, February 1989
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must tell them their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. You may copy and distribute verbatim copies of the Program's 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
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) 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.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.
7. The Free Software Foundation may publish revised and/or new versions
of the 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 Program
specifies a version number of the 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 Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.
8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, 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
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
10. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C) 19yy
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see .
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19xx name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
, 1 April 1989
Moe Ghoul, President of Vice
That's all there is to it!
--- The Perl Artistic License 1.0 ---
This software is Copyright (c) 2010 by Ricardo Signes.
This is free software, licensed under:
The Perl Artistic License 1.0
The "Artistic License"
Preamble
The intent of this document is to state the conditions under which a
Package may be copied, such that the Copyright Holder maintains some
semblance of artistic control over the development of the package,
while giving the users of the package the right to use and distribute
the Package in a more-or-less customary fashion, plus the right to make
reasonable modifications.
Definitions:
"Package" refers to the collection of files distributed by the
Copyright Holder, and derivatives of that collection of files
created through textual modification.
"Standard Version" refers to such a Package if it has not been
modified, or has been modified in accordance with the wishes
of the Copyright Holder as specified below.
"Copyright Holder" is whoever is named in the copyright or
copyrights for the package.
"You" is you, if you're thinking about copying or distributing
this Package.
"Reasonable copying fee" is whatever you can justify on the
basis of media cost, duplication charges, time of people involved,
and so on. (You will not be required to justify it to the
Copyright Holder, but only to the computing community at large
as a market that must bear the fee.)
"Freely Available" means that no fee is charged for the item
itself, though there may be fees involved in handling the item.
It also means that recipients of the item may redistribute it
under the same conditions they received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications
derived from the Public Domain or from the Copyright Holder. A Package
modified in such a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided
that you insert a prominent notice in each changed file stating how and
when you changed that file, and provided that you do at least ONE of the
following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or
an equivalent medium, or placing the modifications on a major archive
site such as uunet.uu.net, or by allowing the Copyright Holder to include
your modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict
with standard executables, which must also be provided, and provide
a separate manual page for each non-standard executable that clearly
documents how it differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or
executable form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
together with instructions (in the manual page or equivalent) on where
to get the Standard Version.
b) accompany the distribution with the machine-readable source of
the Package with your modifications.
c) give non-standard executables non-standard names, and clearly
document the differences in manual pages (or equivalent), together
with instructions on where to get the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this
Package. You may charge any fee you choose for support of this
Package. You may not charge a fee for this Package itself. However,
you may distribute this Package in aggregate with other (possibly
commercial) programs as part of a larger (possibly commercial) software
distribution provided that you do not advertise this Package as a
product of your own. You may embed this Package's interpreter within
an executable of yours (by linking); this shall be construed as a mere
form of aggregation, provided that the complete Standard Version of the
interpreter is so embedded.
6. The scripts and library files supplied as input to or produced as
output from the programs of this Package do not automatically fall
under the copyright of this Package, but belong to whoever generated
them, and may be sold commercially, and may be aggregated with this
Package. If such scripts or library files are aggregated with this
Package via the so-called "undump" or "unexec" methods of producing a
binary executable image, then distribution of such an image shall
neither be construed as a distribution of this Package nor shall it
fall under the restrictions of Paragraphs 3 and 4, provided that you do
not represent such an executable image as a Standard Version of this
Package.
7. C subroutines (or comparably compiled subroutines in other
languages) supplied by you and linked into this Package in order to
emulate subroutines and variables of the language defined by this
Package shall not be considered part of this Package, but are the
equivalent of input as in Paragraph 6, provided these subroutines do
not change the language in any way that would cause it to fail the
regression tests for the language.
8. Aggregation of this Package with a commercial distribution is always
permitted provided that the use of this Package is embedded; that is,
when no overt attempt is made to make this Package's interfaces visible
to the end user of the commercial distribution. Such use shall not be
construed as a distribution of this Package.
9. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End
dist.ini 100644 000765 000024 756 15154420551 15023 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032 name = Test-Routine
author = Ricardo Signes
license = Perl_5
copyright_holder = Ricardo Signes
copyright_year = 2010
[=inc::BuildDemo]
[@Filter]
-bundle = @RJBS
-remove = AutoPrereqs
perl-window = standard
[AutoPrereqs]
skip = HashTester
skip = Test::ThingHasID
skip = MooseX::Role::Parameterized
skip = t::lib::NoGood
skip = MooseX::Method::Signatures
[Prereqs]
Test::More = 0.96 ; subtest with implicit done_testing
[PruneFiles]
filename = inc/BuildDemo.pm
t 000755 000765 000024 0 15154420551 13472 5 ustar 00rjbs staff 000000 000000 Test-Routine-0.032 dupe.t 100644 000765 000024 641 15154420551 14735 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t use strict;
use warnings;
use Test::More;
use Test::Fatal;
use lib 't/lib';
{
my $err = exception { require NoGood };
like(
$err,
qr/with the same name/,
"having two tests with the same name is disallowed",
);
}
{
my $err = exception { require NoGood2 };
like(
$err,
qr/there's already a subroutine named/,
"a test/subroutine name mismatch is not allowed",
);
}
done_testing;
mxms.t 100644 000765 000024 3421 15154420551 15003 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t #!perl
use strict;
use warnings;
use Test::More;
use Test::Moose;
use Test::Fatal;
use Test::Builder::Tester;
BEGIN {
eval { require MooseX::Method::Signatures; 1 }
|| plan skip_all => "This test requires MooseX::Method::Signatures";
}
my $TBV = Test::Builder->VERSION;
{
package Test::Foo;
use Test::Routine;
use Test::Routine::Util;
use MooseX::Method::Signatures;
::is(::exception {
test 'foo bar' => method {
::does_ok($self, 'Test::Foo');
};
}, undef, "can create tests with methods");
if ($TBV >= 0.9805 && $TBV < 1.002) {
::test_out(" # tests work");
::test_out(" # foo bar");
} elsif ($TBV > 1.002) {
::test_out("# tests work");
::test_out(" # foo bar");
}
::test_out(" ok 1 - The object does Test::Foo");
::test_out(" 1..1");
::test_out(" ok 1 - foo bar");
::test_out(" 1..1");
::test_out("ok 1 - tests work");
run_me('tests work');
::test_test();
}
{
package Test::Bar;
use Test::Routine;
use Test::Routine::Util;
use MooseX::Method::Signatures;
::is(::exception {
test 'foo bar' => { description => 'foobar' } => method {
::does_ok($self, 'Test::Bar');
};
}, undef, "can create tests with methods");
if ($TBV >= 0.9805 && $TBV < 1.002) {
::test_out(" # tests work");
::test_out(" # foobar");
} elsif ($TBV > 1.002) {
::test_out("# tests work");
::test_out(" # foobar");
}
::test_out(" ok 1 - The object does Test::Bar");
::test_out(" 1..1");
::test_out(" ok 1 - foobar");
::test_out(" 1..1");
::test_out("ok 1 - tests work");
run_me('tests work');
::test_test();
}
done_testing;
META.yml 100644 000765 000024 32521 15154420551 14663 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032 ---
abstract: 'composable units of assertion'
author:
- 'Ricardo Signes '
build_requires:
ExtUtils::MakeMaker: '0'
File::Spec: '0'
Math::Trig: '0'
Test::Builder::Tester: '0'
Test::Fatal: '0'
Test::Moose: '0'
Test::More: '0.96'
lib: '0'
configure_requires:
ExtUtils::MakeMaker: '6.78'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.037, CPAN::Meta::Converter version 2.150013'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: Test-Routine
requires:
Carp: '0'
Class::Load: '0'
Moose: '0'
Moose::Exporter: '0'
Moose::Meta::Class: '0'
Moose::Meta::Method: '0'
Moose::Role: '0'
Moose::Util: '0'
Moose::Util::TypeConstraints: '0'
Params::Util: '0'
Scalar::Util: '0'
Sub::Exporter: '0'
Sub::Exporter::Util: '0'
Test2::API: '1.302045'
Test::Abortable: '0.002'
Test::More: '0.96'
Try::Tiny: '0'
namespace::autoclean: '0'
namespace::clean: '0'
perl: v5.12.0
strict: '0'
warnings: '0'
resources:
bugtracker: https://github.com/rjbs/Test-Routine/issues
homepage: https://github.com/rjbs/Test-Routine
repository: https://github.com/rjbs/Test-Routine.git
version: '0.032'
x_Dist_Zilla:
perl:
version: '5.040001'
plugins:
-
class: inc::BuildDemo
name: =inc::BuildDemo
version: ~
-
class: Dist::Zilla::Plugin::Git::GatherDir
config:
Dist::Zilla::Plugin::GatherDir:
exclude_filename: []
exclude_match: []
include_dotfiles: 0
prefix: ''
prune_directory: []
root: .
Dist::Zilla::Plugin::Git::GatherDir:
include_untracked: 0
name: '@Filter/Git::GatherDir'
version: '2.052'
-
class: Dist::Zilla::Plugin::CheckPrereqsIndexed
name: '@Filter/CheckPrereqsIndexed'
version: '0.022'
-
class: Dist::Zilla::Plugin::CheckExtraTests
name: '@Filter/CheckExtraTests'
version: '0.029'
-
class: Dist::Zilla::Plugin::PromptIfStale
config:
Dist::Zilla::Plugin::PromptIfStale:
check_all_plugins: 0
check_all_prereqs: 0
modules:
- Dist::Zilla::PluginBundle::RJBS
phase: build
run_under_travis: 0
skip: []
name: '@Filter/RJBS-Outdated'
version: '0.060'
-
class: Dist::Zilla::Plugin::PromptIfStale
config:
Dist::Zilla::Plugin::PromptIfStale:
check_all_plugins: 1
check_all_prereqs: 0
modules: []
phase: release
run_under_travis: 0
skip:
- Dist::Zilla::Plugin::RJBSMisc
name: '@Filter/CPAN-Outdated'
version: '0.060'
-
class: Dist::Zilla::Plugin::PruneCruft
name: '@Filter/@Filter/PruneCruft'
version: '6.037'
-
class: Dist::Zilla::Plugin::ManifestSkip
name: '@Filter/@Filter/ManifestSkip'
version: '6.037'
-
class: Dist::Zilla::Plugin::MetaYAML
name: '@Filter/@Filter/MetaYAML'
version: '6.037'
-
class: Dist::Zilla::Plugin::License
name: '@Filter/@Filter/License'
version: '6.037'
-
class: Dist::Zilla::Plugin::Readme
name: '@Filter/@Filter/Readme'
version: '6.037'
-
class: Dist::Zilla::Plugin::ExecDir
name: '@Filter/@Filter/ExecDir'
version: '6.037'
-
class: Dist::Zilla::Plugin::ShareDir
name: '@Filter/@Filter/ShareDir'
version: '6.037'
-
class: Dist::Zilla::Plugin::Manifest
name: '@Filter/@Filter/Manifest'
version: '6.037'
-
class: Dist::Zilla::Plugin::TestRelease
name: '@Filter/@Filter/TestRelease'
version: '6.037'
-
class: Dist::Zilla::Plugin::ConfirmRelease
name: '@Filter/@Filter/ConfirmRelease'
version: '6.037'
-
class: Dist::Zilla::Plugin::UploadToCPAN
name: '@Filter/@Filter/UploadToCPAN'
version: '6.037'
-
class: Dist::Zilla::Plugin::MakeMaker
config:
Dist::Zilla::Role::TestRunner:
default_jobs: 9
name: '@Filter/MakeMaker'
version: '6.037'
-
class: Dist::Zilla::Plugin::Git::NextVersion
config:
Dist::Zilla::Plugin::Git::NextVersion:
first_version: '0.001'
version_by_branch: 1
version_regexp: (?^:^([0-9]+\.[0-9]+)$)
Dist::Zilla::Role::Git::Repo:
git_version: '2.50.1 (Apple Git-155)'
repo_root: .
name: '@Filter/Git::NextVersion'
version: '2.052'
-
class: Dist::Zilla::Plugin::PkgVersion
name: '@Filter/PkgVersion'
version: '6.037'
-
class: Dist::Zilla::Plugin::MetaConfig
name: '@Filter/MetaConfig'
version: '6.037'
-
class: Dist::Zilla::Plugin::MetaJSON
name: '@Filter/MetaJSON'
version: '6.037'
-
class: Dist::Zilla::Plugin::NextRelease
name: '@Filter/NextRelease'
version: '6.037'
-
class: Dist::Zilla::Plugin::Test::ChangesHasContent
name: '@Filter/Test::ChangesHasContent'
version: '0.011'
-
class: Dist::Zilla::Plugin::PodSyntaxTests
name: '@Filter/PodSyntaxTests'
version: '6.037'
-
class: Dist::Zilla::Plugin::Test::ReportPrereqs
name: '@Filter/Test::ReportPrereqs'
version: '0.029'
-
class: Dist::Zilla::Plugin::Git::Remote::Check
name: '@Filter/Git::Remote::Check'
version: 0.1.2
-
class: Dist::Zilla::Plugin::Test::Compile
config:
Dist::Zilla::Plugin::Test::Compile:
bail_out_on_fail: 1
fail_on_warning: author
fake_home: 0
filename: xt/author/00-compile.t
module_finder:
- ':InstallModules'
needs_display: 0
phase: develop
script_finder:
- ':PerlExecFiles'
skips: []
switch: []
name: '@Filter/Test::Compile'
version: '2.059'
-
class: Dist::Zilla::Plugin::Prereqs
config:
Dist::Zilla::Plugin::Prereqs:
phase: test
type: requires
name: '@Filter/TestMoreWithSubtests'
version: '6.037'
-
class: Dist::Zilla::Plugin::PodWeaver
config:
Dist::Zilla::Plugin::PodWeaver:
config_plugins:
- '@RJBS'
finder:
- ':InstallModules'
- ':PerlExecFiles'
plugins:
-
class: Pod::Weaver::Plugin::EnsurePod5
name: '@CorePrep/EnsurePod5'
version: '4.020'
-
class: Pod::Weaver::Plugin::H1Nester
name: '@CorePrep/H1Nester'
version: '4.020'
-
class: Pod::Weaver::Plugin::SingleEncoding
name: '@RJBS/SingleEncoding'
version: '4.020'
-
class: Pod::Weaver::Section::Name
name: '@RJBS/Name'
version: '4.020'
-
class: Pod::Weaver::Section::Version
name: '@RJBS/Version'
version: '4.020'
-
class: Pod::Weaver::Section::Region
name: '@RJBS/Prelude'
version: '4.020'
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Synopsis'
version: '4.020'
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Description'
version: '4.020'
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Overview'
version: '4.020'
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Stability'
version: '4.020'
-
class: Pod::Weaver::Section::GenerateSection
name: '@RJBS/PerlSupport'
version: '4.020'
-
class: Pod::Weaver::Section::Collect
name: Attributes
version: '4.020'
-
class: Pod::Weaver::Section::Collect
name: Methods
version: '4.020'
-
class: Pod::Weaver::Section::Collect
name: Functions
version: '4.020'
-
class: Pod::Weaver::Section::Leftovers
name: '@RJBS/Leftovers'
version: '4.020'
-
class: Pod::Weaver::Section::Region
name: '@RJBS/postlude'
version: '4.020'
-
class: Pod::Weaver::Section::Authors
name: '@RJBS/Authors'
version: '4.020'
-
class: Pod::Weaver::Section::Contributors
name: '@RJBS/Contributors'
version: '0.009'
-
class: Pod::Weaver::Section::Legal
name: '@RJBS/Legal'
version: '4.020'
-
class: Pod::Weaver::Plugin::Transformer
name: '@RJBS/List'
version: '4.020'
name: '@Filter/PodWeaver'
version: '4.010'
-
class: Dist::Zilla::Plugin::RJBSMisc
name: '@Filter/RJBSMisc'
version: '5.036'
-
class: Dist::Zilla::Plugin::GithubMeta
name: '@Filter/GithubMeta'
version: '0.58'
-
class: Dist::Zilla::Plugin::Git::Check
config:
Dist::Zilla::Plugin::Git::Check:
untracked_files: die
Dist::Zilla::Role::Git::DirtyFiles:
allow_dirty:
- Changes
- dist.ini
allow_dirty_match: []
changelog: Changes
Dist::Zilla::Role::Git::Repo:
git_version: '2.50.1 (Apple Git-155)'
repo_root: .
name: '@Filter/@Git/Check'
version: '2.052'
-
class: Dist::Zilla::Plugin::Git::Commit
config:
Dist::Zilla::Plugin::Git::Commit:
add_files_in: []
commit_msg: v%V%n%n%c
signoff: 0
Dist::Zilla::Role::Git::DirtyFiles:
allow_dirty:
- Changes
- dist.ini
allow_dirty_match: []
changelog: Changes
Dist::Zilla::Role::Git::Repo:
git_version: '2.50.1 (Apple Git-155)'
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
name: '@Filter/@Git/Commit'
version: '2.052'
-
class: Dist::Zilla::Plugin::Git::Tag
config:
Dist::Zilla::Plugin::Git::Tag:
branch: ~
changelog: Changes
signed: 0
tag: '0.032'
tag_format: '%v'
tag_message: v%V
Dist::Zilla::Role::Git::Repo:
git_version: '2.50.1 (Apple Git-155)'
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
name: '@Filter/@Git/Tag'
version: '2.052'
-
class: Dist::Zilla::Plugin::Git::Push
config:
Dist::Zilla::Plugin::Git::Push:
push_to:
- 'github :'
remotes_must_exist: 0
Dist::Zilla::Role::Git::Repo:
git_version: '2.50.1 (Apple Git-155)'
repo_root: .
name: '@Filter/@Git/Push'
version: '2.052'
-
class: Dist::Zilla::Plugin::Git::Contributors
config:
Dist::Zilla::Plugin::Git::Contributors:
git_version: '2.50.1 (Apple Git-155)'
include_authors: 0
include_releaser: 1
order_by: name
paths: []
remove: ...
name: '@Filter/Git::Contributors'
version: '0.039'
-
class: Dist::Zilla::Plugin::AutoPrereqs
name: AutoPrereqs
version: '6.037'
-
class: Dist::Zilla::Plugin::Prereqs
config:
Dist::Zilla::Plugin::Prereqs:
phase: runtime
type: requires
name: Prereqs
version: '6.037'
-
class: Dist::Zilla::Plugin::PruneFiles
name: PruneFiles
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':InstallModules'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':IncModules'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':TestFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExtraTestFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExecFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':PerlExecFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ShareFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':MainModule'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':AllFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':NoFiles'
version: '6.037'
zilla:
class: Dist::Zilla::Dist::Builder
config:
is_trial: 0
version: '6.037'
x_contributors:
- 'Alex White '
- 'Dagfinn Ilmari Mannsåker '
- 'gregor herrmann '
- 'Jesse Luehrs '
- 'Matthew Horsfall '
- 'Ricardo Signes '
- 'Yanick Champoux '
x_generated_by_perl: v5.40.1
x_rjbs_perl_window: standard
x_serialization_backend: 'YAML::Tiny version 1.76'
x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later'
MANIFEST 100644 000765 000024 1367 15154420551 14527 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.037
Changes
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
dist.ini
lib/Test/Routine.pm
lib/Test/Routine/Common.pm
lib/Test/Routine/Compositor.pm
lib/Test/Routine/Manual/Demo.pm
lib/Test/Routine/Runner.pm
lib/Test/Routine/Runner/NoSubtest.pm
lib/Test/Routine/Test.pm
lib/Test/Routine/Test/Role.pm
lib/Test/Routine/Util.pm
t/00-report-prereqs.dd
t/00-report-prereqs.t
t/abort.t
t/demo/01-demo.t
t/demo/02-simple.t
t/demo/03-advice.t
t/demo/04-misc.t
t/demo/05-multiple.t
t/dupe.t
t/lib/NoGood.pm
t/lib/NoGood2.pm
t/method-filter.t
t/mxms.t
t/return.t
t/test-traits.t
t/todo/mxrp.t
t/unsafe-name.t
xt/author/00-compile.t
xt/author/pod-syntax.t
xt/release/changes_has_content.t
abort.t 100644 000765 000024 5106 15154420551 15130 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t use strict;
use warnings;
use Test2::API qw(intercept);
use Test::More;
use Test::Routine::Util;
{
package Abort::Test;
sub throw {
my $self = bless $_[1], $_[0];
die $self;
}
sub as_test_abort_events {
my @diag = @{ $_[0]{diagnostics} || [] };
return [
[ Ok => (pass => $_[0]{pass} || 0, name => $_[0]{description}) ],
map {; [ Diag => (message => $_) ] } @diag,
];
}
}
{
package Abortive;
use Test::Routine;
use Test::More;
use namespace::autoclean;
test "this test will abort" => sub {
my ($self) = @_;
pass("one");
pass("two");
Abort::Test->throw({
description => "just give up",
});
pass("three");
pass("four");
pass("five");
};
test "this will run just fine" => sub {
pass("everything is just fine");
};
test "I like fine wines and cheeses" => sub {
pass("wine wine wine wine cheese");
Abort::Test->throw({
pass => 1,
description => "that was enough wine and cheese",
diagnostics => [ "Fine wine", "Fine cheese" ],
});
fail("feeling gross");
};
}
my $events = intercept {
run_tests("test run with aborts", 'Abortive');
};
my @top = grep {; $_->isa('Test2::Event::Subtest') } @$events;
is(@top, 1, "we have only the one top-level subtest for Routine");
my @subtests = grep {; $_->isa('Test2::Event::Subtest') }
@{ $top[0]->subevents };
is(@subtests, 3, "we ran three subtests (the three test methods)");
subtest "first subtest" => sub {
my @oks = grep {; $_->isa('Test2::Event::Ok') } @{ $subtests[0]->subevents };
is(@oks, 3, "three pass/fail events");
ok($oks[0]->pass, "first passed");
ok($oks[1]->pass, "second passed");
ok(! $oks[2]->pass, "third failed");
is($oks[2]->name, "just give up", "the final Ok test looks like our abort");
isa_ok($oks[2]->get_meta('test_abort_object'), 'Abort::Test', 'test_abort_object');
};
subtest "third subtest" => sub {
my @oks = grep {; $_->isa('Test2::Event::Ok') } @{ $subtests[2]->subevents };
is(@oks, 2, "two pass/fail events");
ok($oks[0]->pass, "first passed");
ok($oks[1]->pass, "second passed");
is(
$oks[1]->name,
"that was enough wine and cheese",
"the final Ok test looks like our abort"
);
isa_ok($oks[1]->get_meta('test_abort_object'), 'Abort::Test', 'test_abort_object');
my @diags = grep {; $_->isa('Test2::Event::Diag') } @{ $subtests[2]->subevents };
is(@diags, 2, "we have two diagnostics");
is_deeply(
[ map {; $_->message } @diags ],
[
"Fine wine",
"Fine cheese",
],
"...which we expected",
);
};
done_testing;
META.json 100644 000765 000024 51557 15154420551 15045 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032 {
"abstract" : "composable units of assertion",
"author" : [
"Ricardo Signes "
],
"dynamic_config" : 0,
"generated_by" : "Dist::Zilla version 6.037, CPAN::Meta::Converter version 2.150013",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : 2
},
"name" : "Test-Routine",
"prereqs" : {
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "6.78"
}
},
"develop" : {
"requires" : {
"Encode" : "0",
"File::Spec" : "0",
"IO::Handle" : "0",
"IPC::Open3" : "0",
"Test::More" : "0.94",
"Test::Pod" : "1.41"
}
},
"runtime" : {
"requires" : {
"Carp" : "0",
"Class::Load" : "0",
"Moose" : "0",
"Moose::Exporter" : "0",
"Moose::Meta::Class" : "0",
"Moose::Meta::Method" : "0",
"Moose::Role" : "0",
"Moose::Util" : "0",
"Moose::Util::TypeConstraints" : "0",
"Params::Util" : "0",
"Scalar::Util" : "0",
"Sub::Exporter" : "0",
"Sub::Exporter::Util" : "0",
"Test2::API" : "1.302045",
"Test::Abortable" : "0.002",
"Test::More" : "0.96",
"Try::Tiny" : "0",
"namespace::autoclean" : "0",
"namespace::clean" : "0",
"perl" : "v5.12.0",
"strict" : "0",
"warnings" : "0"
}
},
"test" : {
"recommends" : {
"CPAN::Meta" : "2.120900"
},
"requires" : {
"ExtUtils::MakeMaker" : "0",
"File::Spec" : "0",
"Math::Trig" : "0",
"Test::Builder::Tester" : "0",
"Test::Fatal" : "0",
"Test::Moose" : "0",
"Test::More" : "0.96",
"lib" : "0"
}
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "https://github.com/rjbs/Test-Routine/issues"
},
"homepage" : "https://github.com/rjbs/Test-Routine",
"repository" : {
"type" : "git",
"url" : "https://github.com/rjbs/Test-Routine.git",
"web" : "https://github.com/rjbs/Test-Routine"
}
},
"version" : "0.032",
"x_Dist_Zilla" : {
"perl" : {
"version" : "5.040001"
},
"plugins" : [
{
"class" : "inc::BuildDemo",
"name" : "=inc::BuildDemo",
"version" : null
},
{
"class" : "Dist::Zilla::Plugin::Git::GatherDir",
"config" : {
"Dist::Zilla::Plugin::GatherDir" : {
"exclude_filename" : [],
"exclude_match" : [],
"include_dotfiles" : 0,
"prefix" : "",
"prune_directory" : [],
"root" : "."
},
"Dist::Zilla::Plugin::Git::GatherDir" : {
"include_untracked" : 0
}
},
"name" : "@Filter/Git::GatherDir",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed",
"name" : "@Filter/CheckPrereqsIndexed",
"version" : "0.022"
},
{
"class" : "Dist::Zilla::Plugin::CheckExtraTests",
"name" : "@Filter/CheckExtraTests",
"version" : "0.029"
},
{
"class" : "Dist::Zilla::Plugin::PromptIfStale",
"config" : {
"Dist::Zilla::Plugin::PromptIfStale" : {
"check_all_plugins" : 0,
"check_all_prereqs" : 0,
"modules" : [
"Dist::Zilla::PluginBundle::RJBS"
],
"phase" : "build",
"run_under_travis" : 0,
"skip" : []
}
},
"name" : "@Filter/RJBS-Outdated",
"version" : "0.060"
},
{
"class" : "Dist::Zilla::Plugin::PromptIfStale",
"config" : {
"Dist::Zilla::Plugin::PromptIfStale" : {
"check_all_plugins" : 1,
"check_all_prereqs" : 0,
"modules" : [],
"phase" : "release",
"run_under_travis" : 0,
"skip" : [
"Dist::Zilla::Plugin::RJBSMisc"
]
}
},
"name" : "@Filter/CPAN-Outdated",
"version" : "0.060"
},
{
"class" : "Dist::Zilla::Plugin::PruneCruft",
"name" : "@Filter/@Filter/PruneCruft",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::ManifestSkip",
"name" : "@Filter/@Filter/ManifestSkip",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::MetaYAML",
"name" : "@Filter/@Filter/MetaYAML",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::License",
"name" : "@Filter/@Filter/License",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::Readme",
"name" : "@Filter/@Filter/Readme",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::ExecDir",
"name" : "@Filter/@Filter/ExecDir",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::ShareDir",
"name" : "@Filter/@Filter/ShareDir",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::Manifest",
"name" : "@Filter/@Filter/Manifest",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::TestRelease",
"name" : "@Filter/@Filter/TestRelease",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::ConfirmRelease",
"name" : "@Filter/@Filter/ConfirmRelease",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::UploadToCPAN",
"name" : "@Filter/@Filter/UploadToCPAN",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::MakeMaker",
"config" : {
"Dist::Zilla::Role::TestRunner" : {
"default_jobs" : 9
}
},
"name" : "@Filter/MakeMaker",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::Git::NextVersion",
"config" : {
"Dist::Zilla::Plugin::Git::NextVersion" : {
"first_version" : "0.001",
"version_by_branch" : 1,
"version_regexp" : "(?^:^([0-9]+\\.[0-9]+)$)"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.50.1 (Apple Git-155)",
"repo_root" : "."
}
},
"name" : "@Filter/Git::NextVersion",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::PkgVersion",
"name" : "@Filter/PkgVersion",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::MetaConfig",
"name" : "@Filter/MetaConfig",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::MetaJSON",
"name" : "@Filter/MetaJSON",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::NextRelease",
"name" : "@Filter/NextRelease",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::Test::ChangesHasContent",
"name" : "@Filter/Test::ChangesHasContent",
"version" : "0.011"
},
{
"class" : "Dist::Zilla::Plugin::PodSyntaxTests",
"name" : "@Filter/PodSyntaxTests",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::Test::ReportPrereqs",
"name" : "@Filter/Test::ReportPrereqs",
"version" : "0.029"
},
{
"class" : "Dist::Zilla::Plugin::Git::Remote::Check",
"name" : "@Filter/Git::Remote::Check",
"version" : "0.1.2"
},
{
"class" : "Dist::Zilla::Plugin::Test::Compile",
"config" : {
"Dist::Zilla::Plugin::Test::Compile" : {
"bail_out_on_fail" : 1,
"fail_on_warning" : "author",
"fake_home" : 0,
"filename" : "xt/author/00-compile.t",
"module_finder" : [
":InstallModules"
],
"needs_display" : 0,
"phase" : "develop",
"script_finder" : [
":PerlExecFiles"
],
"skips" : [],
"switch" : []
}
},
"name" : "@Filter/Test::Compile",
"version" : "2.059"
},
{
"class" : "Dist::Zilla::Plugin::Prereqs",
"config" : {
"Dist::Zilla::Plugin::Prereqs" : {
"phase" : "test",
"type" : "requires"
}
},
"name" : "@Filter/TestMoreWithSubtests",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::PodWeaver",
"config" : {
"Dist::Zilla::Plugin::PodWeaver" : {
"config_plugins" : [
"@RJBS"
],
"finder" : [
":InstallModules",
":PerlExecFiles"
],
"plugins" : [
{
"class" : "Pod::Weaver::Plugin::EnsurePod5",
"name" : "@CorePrep/EnsurePod5",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Plugin::H1Nester",
"name" : "@CorePrep/H1Nester",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Plugin::SingleEncoding",
"name" : "@RJBS/SingleEncoding",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Name",
"name" : "@RJBS/Name",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Version",
"name" : "@RJBS/Version",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Region",
"name" : "@RJBS/Prelude",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "@RJBS/Synopsis",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "@RJBS/Description",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "@RJBS/Overview",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "@RJBS/Stability",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::GenerateSection",
"name" : "@RJBS/PerlSupport",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Collect",
"name" : "Attributes",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Collect",
"name" : "Methods",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Collect",
"name" : "Functions",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Leftovers",
"name" : "@RJBS/Leftovers",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Region",
"name" : "@RJBS/postlude",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Authors",
"name" : "@RJBS/Authors",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Contributors",
"name" : "@RJBS/Contributors",
"version" : "0.009"
},
{
"class" : "Pod::Weaver::Section::Legal",
"name" : "@RJBS/Legal",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Plugin::Transformer",
"name" : "@RJBS/List",
"version" : "4.020"
}
]
}
},
"name" : "@Filter/PodWeaver",
"version" : "4.010"
},
{
"class" : "Dist::Zilla::Plugin::RJBSMisc",
"name" : "@Filter/RJBSMisc",
"version" : "5.036"
},
{
"class" : "Dist::Zilla::Plugin::GithubMeta",
"name" : "@Filter/GithubMeta",
"version" : "0.58"
},
{
"class" : "Dist::Zilla::Plugin::Git::Check",
"config" : {
"Dist::Zilla::Plugin::Git::Check" : {
"untracked_files" : "die"
},
"Dist::Zilla::Role::Git::DirtyFiles" : {
"allow_dirty" : [
"Changes",
"dist.ini"
],
"allow_dirty_match" : [],
"changelog" : "Changes"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.50.1 (Apple Git-155)",
"repo_root" : "."
}
},
"name" : "@Filter/@Git/Check",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::Git::Commit",
"config" : {
"Dist::Zilla::Plugin::Git::Commit" : {
"add_files_in" : [],
"commit_msg" : "v%V%n%n%c",
"signoff" : 0
},
"Dist::Zilla::Role::Git::DirtyFiles" : {
"allow_dirty" : [
"Changes",
"dist.ini"
],
"allow_dirty_match" : [],
"changelog" : "Changes"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.50.1 (Apple Git-155)",
"repo_root" : "."
},
"Dist::Zilla::Role::Git::StringFormatter" : {
"time_zone" : "local"
}
},
"name" : "@Filter/@Git/Commit",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::Git::Tag",
"config" : {
"Dist::Zilla::Plugin::Git::Tag" : {
"branch" : null,
"changelog" : "Changes",
"signed" : 0,
"tag" : "0.032",
"tag_format" : "%v",
"tag_message" : "v%V"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.50.1 (Apple Git-155)",
"repo_root" : "."
},
"Dist::Zilla::Role::Git::StringFormatter" : {
"time_zone" : "local"
}
},
"name" : "@Filter/@Git/Tag",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::Git::Push",
"config" : {
"Dist::Zilla::Plugin::Git::Push" : {
"push_to" : [
"github :"
],
"remotes_must_exist" : 0
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.50.1 (Apple Git-155)",
"repo_root" : "."
}
},
"name" : "@Filter/@Git/Push",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::Git::Contributors",
"config" : {
"Dist::Zilla::Plugin::Git::Contributors" : {
"git_version" : "2.50.1 (Apple Git-155)",
"include_authors" : 0,
"include_releaser" : 1,
"order_by" : "name",
"paths" : [],
"remove" : "..."
}
},
"name" : "@Filter/Git::Contributors",
"version" : "0.039"
},
{
"class" : "Dist::Zilla::Plugin::AutoPrereqs",
"name" : "AutoPrereqs",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::Prereqs",
"config" : {
"Dist::Zilla::Plugin::Prereqs" : {
"phase" : "runtime",
"type" : "requires"
}
},
"name" : "Prereqs",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::PruneFiles",
"name" : "PruneFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":InstallModules",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":IncModules",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":TestFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ExtraTestFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ExecFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":PerlExecFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ShareFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":MainModule",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":AllFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":NoFiles",
"version" : "6.037"
}
],
"zilla" : {
"class" : "Dist::Zilla::Dist::Builder",
"config" : {
"is_trial" : 0
},
"version" : "6.037"
}
},
"x_contributors" : [
"Alex White ",
"Dagfinn Ilmari Manns\u00e5ker ",
"gregor herrmann ",
"Jesse Luehrs ",
"Matthew Horsfall ",
"Ricardo Signes ",
"Yanick Champoux "
],
"x_generated_by_perl" : "v5.40.1",
"x_rjbs_perl_window" : "standard",
"x_serialization_backend" : "Cpanel::JSON::XS version 4.40",
"x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later"
}
return.t 100644 000765 000024 4044 15154420551 15340 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t use strict;
use warnings;
use Test2::API qw(intercept);
use Test::More;
use Test::Routine::Util;
{
package ThisFails;
use Test::Routine;
use Test::More;
test "this test will pass" => sub {
pass("one");
pass("two");
pass("three");
};
test "this test will fail" => sub {
pass("one");
fail("two");
pass("three");
};
around run_test => sub {
my ($orig, $self, @rest) = @_;
my $rc = $self->$orig(@rest);
diag $rc ? "pass-result" : "fail-result";
};
}
my $events = intercept {
run_tests("test run with aborts", 'ThisFails');
};
my @top = grep {; $_->isa('Test2::Event::Subtest') } @$events;
is(@top, 1, "we have one top-level subtest for Routine");
my @subtests = grep {; $_->isa('Test2::Event::Subtest') }
@{ $top[0]->subevents };
is(@subtests, 2, "we ran two subtests (the two test methods)");
subtest "first subtest" => sub {
my @subevents = @{ $subtests[0]->subevents };
my @oks = grep {; $_->isa('Test2::Event::Ok') } @subevents;
is(@oks, 3, "three pass/fail events");
ok($oks[0]->pass, "assertion passed");
is($oks[0]->name, "one", "correct name");
ok($oks[1]->pass, "assertion passed");
is($oks[1]->name, "two", "correct name");
ok($oks[2]->pass, "assertion passed");
is($oks[2]->name, "three", "correct name");
};
subtest "second subtest" => sub {
my @subevents = @{ $subtests[1]->subevents };
my @oks = grep {; $_->isa('Test2::Event::Ok') } @subevents;
is(@oks, 3, "three pass/fail events");
ok($oks[0]->pass, "assertion passed");
is($oks[0]->name, "one", "correct name");
ok(!$oks[1]->pass, "assertion failed");
is($oks[1]->name, "two", "correct name");
ok($oks[2]->pass, "assertion passed");
is($oks[2]->name, "three", "correct name");
};
{
my @diags = grep {; $_->isa('Test2::Event::Diag') } @{ $top[0]->subevents };
is(
(grep {; $_->message eq 'pass-result' } @diags),
1,
"we got one pass-result",
);
is(
(grep {; $_->message eq 'fail-result' } @diags),
1,
"we got one fail-result",
);
};
done_testing;
__END__
Makefile.PL 100644 000765 000024 4610 15154420551 15342 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.037
use strict;
use warnings;
use 5.012000;
use ExtUtils::MakeMaker 6.78;
my %WriteMakefileArgs = (
"ABSTRACT" => "composable units of assertion",
"AUTHOR" => "Ricardo Signes ",
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => "6.78"
},
"DISTNAME" => "Test-Routine",
"LICENSE" => "perl",
"MIN_PERL_VERSION" => "5.012000",
"NAME" => "Test::Routine",
"PREREQ_PM" => {
"Carp" => 0,
"Class::Load" => 0,
"Moose" => 0,
"Moose::Exporter" => 0,
"Moose::Meta::Class" => 0,
"Moose::Meta::Method" => 0,
"Moose::Role" => 0,
"Moose::Util" => 0,
"Moose::Util::TypeConstraints" => 0,
"Params::Util" => 0,
"Scalar::Util" => 0,
"Sub::Exporter" => 0,
"Sub::Exporter::Util" => 0,
"Test2::API" => "1.302045",
"Test::Abortable" => "0.002",
"Test::More" => "0.96",
"Try::Tiny" => 0,
"namespace::autoclean" => 0,
"namespace::clean" => 0,
"strict" => 0,
"warnings" => 0
},
"TEST_REQUIRES" => {
"ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
"Math::Trig" => 0,
"Test::Builder::Tester" => 0,
"Test::Fatal" => 0,
"Test::Moose" => 0,
"Test::More" => "0.96",
"lib" => 0
},
"VERSION" => "0.032",
"test" => {
"TESTS" => "t/*.t t/demo/*.t t/todo/*.t"
}
);
my %FallbackPrereqs = (
"Carp" => 0,
"Class::Load" => 0,
"ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
"Math::Trig" => 0,
"Moose" => 0,
"Moose::Exporter" => 0,
"Moose::Meta::Class" => 0,
"Moose::Meta::Method" => 0,
"Moose::Role" => 0,
"Moose::Util" => 0,
"Moose::Util::TypeConstraints" => 0,
"Params::Util" => 0,
"Scalar::Util" => 0,
"Sub::Exporter" => 0,
"Sub::Exporter::Util" => 0,
"Test2::API" => "1.302045",
"Test::Abortable" => "0.002",
"Test::Builder::Tester" => 0,
"Test::Fatal" => 0,
"Test::Moose" => 0,
"Test::More" => "0.96",
"Try::Tiny" => 0,
"lib" => 0,
"namespace::autoclean" => 0,
"namespace::clean" => 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);
todo 000755 000765 000024 0 15154420551 14437 5 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t mxrp.t 100644 000765 000024 1532 15154420551 15753 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t/todo #!/bin/env perl
use strict;
use warnings;
use Test::Routine::Util;
use Test::More;
BEGIN { plan skip_all => 'Test::Routine and MXRP not yet compatible'; }
{
package Test::ThingHasID;
use MooseX::Role::Parameterized;
use Test::Routine;
use Test::More;
parameter id_method => (
is => 'ro',
isa => 'Str',
default => 'id',
);
role {
my $p = shift;
my $id_method = $p->id_method;
requires $id_method;
test thing_has_numeric_id => sub {
my ($self) = @_;
my $id = $self->$id_method;
like($id, qr/\A[0-9]+\z/, "the thing's id is a string of ascii digits");
};
}
}
{
package HasIdentifier;
use Moose;
with 'Test::ThingHasID' => { id_method => 'identifier' };
sub identifier { return 123 }
}
run_tests(
"we can use mxrp",
'HasIdentifier',
);
# ...and we're done!
done_testing;
lib 000755 000765 000024 0 15154420551 14240 5 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t NoGood.pm 100644 000765 000024 247 15154420551 16106 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t/lib package NoGood;
use Test::Routine;
test "this will be duplicated" => sub { die 'Unimplemented' };
test "this will be duplicated" => sub { die 'Unimplemented' };
1;
test-traits.t 100644 000765 000024 2465 15154420551 16311 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t #!/bin/env perl
use strict;
use warnings;
use lib 't/lib';
use Test::More;
use Test::Routine;
use Test::Routine::Util;
use namespace::autoclean;
{
package Test::Routine::Role::TestWithFlavor;
use Moose::Role;
has flavor => (
is => 'ro',
isa => 'Str',
default => sub { 'vanilla' },
);
around skip_reason => sub {
my ($orig, $self, $test_instance) = @_;
return unless $test_instance->can('only_flavor');
return unless $test_instance->only_flavor;
return if $test_instance->only_flavor eq $self->flavor;
return sprintf "only running %s tests, but test is %s flavor",
$test_instance->only_flavor,
$self->flavor;
return $self->$orig($test_instance);
};
no Moose::Role;
}
{
package Test::Routine::TestsHaveFlavor;
use Moose::Role;
sub test_routine_test_traits {
return 'Test::Routine::Role::TestWithFlavor';
}
no Moose::Role;
}
with 'Test::Routine::TestsHaveFlavor';
has only_flavor => (
is => 'ro',
isa => 'Str',
);
test "I like bananas" => sub {
my ($self) = @_;
ok(1);
};
test "Do you like bananas" => sub {
my ($self) = @_;
ok(1);
};
test "No, cucumbers are best" => { flavor => 'cuke' } => sub {
my ($self) = @_;
ok(1);
};
run_me;
run_me({ only_flavor => 'vanilla' });
run_me({ only_flavor => 'cuke' });
done_testing;
unsafe-name.t 100644 000765 000024 264 15154420551 16200 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t use Test::Routine;
use Test::Routine::Util;
use Test::More;
test "this isn't any problem" => sub { pass };
test "we are testing My::Code" => sub { pass };
run_me;
done_testing;
demo 000755 000765 000024 0 15154420551 14416 5 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t 01-demo.t 100644 000765 000024 13603 15154420551 16130 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t/demo #!/bin/env perl
use strict;
use warnings;
# This test is both a test and an example of how Test::Routine works! Welcome
# to t/01-demo.t, I will be your guide, rjbs.
{
# This block defines the HashTester package. It's a Test::Routine, meaning
# it's a role. We define state that the test will need to keep and any
# requirements we might have.
#
# Before we can run this test, we'll need to compose the role into a class so
# that we can make an instance.
package HashTester;
use Test::Routine;
# We import stuff from Test::More because, well, who wants to re-write all
# those really useful test routines that exist out there? Maybe somebody,
# but not me.
use Test::More;
# ...but then we use namespace::autoclean to get rid of the routines once
# we've bound to them. This is just standard Moose practice, anyway, right?
use namespace::autoclean;
# Finally, some state! Every test will get called as method on an instance,
# and it will have this attribute. Here are some points of interest:
#
# - We're giving this attribute a builder, so it will try to get built with a
# call to $self->build_hash_to_test -- so each class that composes this
# role can provide means for these attributes (fixtures) to be generated as
# needed.
#
# - We are not adding "requires 'build_hash_to_test'", because then we can
# apply this role to Moose::Object and instantiate it with a given value
# in the constructor. There will be an example of this below. This lets
# us re-use these tests in many variations without having to write class
# after class.
#
# - We don't use lazy_build because it would create a clearer. If someone
# then cleared our lazy_build fixture, it could not be re-built in the
# event that we'd gotten it explicitly from the constructor!
#
# Using Moose attributes for our state and fixtures allows us to get all of
# their powerful behaviors like types, delegation, traits, and so on, and
# allows us to decompose shared behavior into roles.
#
has hash_to_test => (
is => 'ro',
isa => 'HashRef',
builder => 'build_hash_to_test',
);
# Here, we're just declaring an actual test that we will run. This sub will
# get installed as a method with a name that won't get clobbered easily. The
# method will be found later by run_tests so we can find and execute all
# tests on an instance.
#
# There is nothing magical about this method! Calling this method is
# performed in a Test::More subtest block. A TAP plan can be issued with
# "plan", and we can issue TODO or SKIP directives the same way. There is
# none of the return-to-skip magic that we find in Test::Class.
#
# The string after "test" is used as the method name -- which means we're
# getting a method name with spaces in it. This can be slightly problematic
# if you try to use, say, ::, in a method name. For the most part, it works
# quite well -- but look at the next test for an example of how to give an
# explicit description.
test "only one key in hash" => sub {
my ($self) = @_;
my $hash = $self->hash_to_test;
is(keys %$hash, 1, "we have one key in our test hash");
is(2+2, 4, "universe still okay");
};
# The only thing of note here is that we're passing a hashref of extra args
# to the test method constructor. "desc" lets us set the test's description,
# which is used in the test output, so we can avoid weird method names being
# installed. Also note that we order tests more or less by order of
# definition, not by name or description.
test second_test => { desc => "Test::Routine demo!" } => sub {
pass("We're running this test second");
pass("...notice that the subtest's label is the 'desc' above");
pass("...and not the method name!");
};
}
{
# This package is one fixture against which we can run the HashTester
# routine. It has the only thing it needs: a build_hash_to_test method.
# Obviously real examples would have more to them than this.
package ProcessHash;
use Moose;
with 'HashTester';
use namespace::autoclean;
sub build_hash_to_test { return { $$ => $^T } }
}
# Now we're into the body of the test program: where tests actually get run.
# We use Test::Routine::Util to get its "run_tests" routine, which runs the
# tests on an instance, building it if needed.
use Test::Routine::Util;
# We use Test::More to get done_testing. We don't assume that run_tests is the
# entire test, because that way we can (as we do here) run multiple test
# instances, and can intersperse other kinds of sanity checks amongst the
# Test::Routine-style tests.
use Test::More;
is(2+2, 4, "universe still makes sense") or BAIL_OUT("PANIC!");
# The first arg is a description for the subtest that will be run. The second,
# here, is a class that will be instantiated and tested.
run_tests('ProcessHash class' => 'ProcessHash');
# Here, the second argument is an instance of a class to test.
run_tests('ProcessHash obj' => ProcessHash->new({ hash_to_test => { 1 => 0 }}));
# We could also just supply a class name and a set of args to pass to new.
# The below is very nearly equivalent to the above:
run_tests('ProcessHash new' => ProcessHash => { hash_to_test => { 1 => 0 }});
# ...and here, the second arg is not a class or instance at all, but the
# Test::Routine role (by name). Since we know we can't instantiate a role,
# run_tests will try to compose it with Moose::Object. Then the args are used
# as the args to ->new on the new class, as above. This lets us write
# Test::Routines that can be tested with the right state to start with, or
# Test::Routines that need to be composed with testing fixture classes.
run_tests(
'HashTester with given state',
HashTester => {
hash_to_test => { a => 1 },
},
);
# There's one more interesting way to run out tests, but it's demonstrated in
# 02-simple.t instead of here. Go check that out.
# ...and we're done!
done_testing;
04-misc.t 100644 000765 000024 2155 15154420551 16122 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t/demo use Test::Routine;
use Test::Routine::Util;
use Test::More;
use namespace::autoclean;
# One thing that the previous examples didn't show was how to mark tests as
# "skipped" or "todo." Test::Routine makes -no- provisions for these
# directives. Instead, it assumes you will use the entirely usable mechanisms
# provided by Test::More.
# This is a normal test. It is neither skipped nor todo.
test boring_ordinary_tests => sub {
pass("This is a plain old boring test that always passes.");
pass("It's here just to remind you what they look like.");
};
# To skip a test, we just add a "skip_all" plan. Because test methods get run
# in subtests, this skips the whole subtest, but nothing else.
test sample_skip_test => sub {
plan skip_all => "these tests don't pass, for some reason";
is(6, 9, "I don't mind.");
};
# To mark a test todo, we just set our local $TODO variable. Because the test
# is its own block, this works just like it would in any other Test::More test.
test sample_todo_test => sub {
local $TODO = 'demo of todo';
is(2 + 2, 5, "we can bend the fabric of reality");
};
run_me;
done_testing;
NoGood2.pm 100644 000765 000024 135 15154420551 16164 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t/lib package NoGood2;
use Test::Routine;
use Math::Trig qw(acos);
test "acos" => sub { 1 };
1;
method-filter.t 100644 000765 000024 2170 15154420551 16562 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t use Test::Routine;
use Test::Routine::Util;
use Test::More;
use Test::Fatal;
my %ran;
my %expected = ( map { $_ => 1 } just => 1..3 );
foreach my $num (1..3) {
test "this must run $num" => sub { pass "must $num"; $ran{$num}++ };
}
test "just this" => sub { pass "just this"; $ran{just}++ };
subtest 'empty TEST_METHOD' => sub {
local $ENV{TEST_METHOD} = '';
run_me 'empty TEST_METHOD';
is_deeply \%ran, \%expected, 'ran all tests';
};
subtest 'TEST_METHOD set' => sub {
test "not to run" => sub { fail };
%ran = ();
{
local $ENV{TEST_METHOD} = 'just this';
run_me 'literal';
}
{
local $ENV{TEST_METHOD} = '.*must.*';
run_me 'regex';
}
is_deeply \%ran, \%expected, "ran each test once";
};
{
# the whole subtest must be TODO, or it fails with "no tests run" for
# the subtest created by run_me()
local $TODO = "Exception gets swallowed somewhere";
subtest 'invalid regex' => sub {
local $ENV{TEST_METHOD} = 'invalid++';
like exception { run_me 'invalid' },
qr/\A\QTEST_METHOD (invalid++) is not a valid regular expression/,
"invalid regex throws";
};
}
done_testing;
02-simple.t 100644 000765 000024 4532 15154420551 16457 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t/demo # Welcome to part two of the Test::Routine demo. This is showing how you can
# write quick one-off tests without having to write a bunch of .pm files or
# (worse?) embed packages in bare blocks in the odious way that 01-demo.t did.
#
# First off, we use Test::Routine. As it did before, this turns the current
# package (main!) into a Test::Routine role. It also has the pleasant
# side-effect of turning on strict and warnings.
use Test::Routine;
# Then we bring in the utils, because we'll want to run_tests later.
use Test::Routine::Util;
# And, finally, we bring in Test::More so that we can use test assertions, and
# namespace::autoclean to clean up after us.
use Test::More;
use namespace::autoclean;
# We're going to give our tests some state. It's nothing special.
has counter => (
is => 'rw',
isa => 'Int',
default => 0,
);
# Then another boring but useful hunk of code: a method for our test routine.
sub counter_is_even {
my ($self) = @_;
return $self->counter % 2 == 0;
}
# Then we can write some tests, just like we did before. Here, we're writing
# several tests, and they will be run in the order in which they were defined.
# You can see that they rely on the state being maintained.
test 'start even' => sub {
my ($self) = @_;
ok($self->counter_is_even, "we start with an even counter");
$self->counter( $self->counter + 1);
};
test 'terminate odd' => sub {
my ($self) = @_;
ok(! $self->counter_is_even, "the counter is odd, so state was preserved");
pass("for your information, the counter is " . $self->counter);
};
# Now we can run these tests just by saying "run_me" -- rather than expecting a
# class or role name, it uses the caller. In this case, the calling package
# (main!) is a Test::Routine, so the runner composes it with Moose::Object,
# instantiating it, and running the tests on the instance.
run_me;
# Since each test run gets its own instance, we can run the test suite again,
# possibly to verify that the test suite is not destructive of some external
# state.
run_me("second run");
# And we can pass in args to use when constructing the object to be tested.
# Given the tests above, we can pick any starting value for "counter" that is
# even.
run_me({ counter => 192 });
# ...and we're done!
done_testing;
# More Test::Routine behavior is demonstrated in t/03-advice.t and t/04-misc.t
# Go have a look at those!
03-advice.t 100644 000765 000024 3333 15154420551 16420 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/t/demo use Test::Routine;
use Test::Routine::Util;
use Test::More;
use namespace::autoclean;
# xUnit style testing has the idea of setup and teardown that happens around
# each test. With Test::Routine, we assume that you will do most of this sort
# of thing in your BUILD, DEMOLISH, and attribute management. Still, you can
# easily do setup and teardown by applying method modifiers to the "run_test"
# method, which your Test::Routine uses to run each test. Here's a simple
# example.
# We have the same boring state that we saw before. It's just an integer that
# is carried over between tests.
has counter => (
is => 'rw',
isa => 'Int',
lazy => 1,
default => 0,
clearer => 'clear_counter',
);
# The first test changes the counter's value and leaves it changed.
test test_0 => sub {
my ($self) = @_;
is($self->counter, 0, 'start with counter = 0');
$self->counter( $self->counter + 1);
is($self->counter, 1, 'end with counter = 1');
};
# The second test assumes that the value is the default, again. We want to
# make sure that before each test, the counter is reset, but we don't want to
# tear down and recreate the whole object, because it may have other, more
# expensive resources built.
test test_1 => sub {
my ($self) = @_;
is($self->counter, 0, 'counter is reset between tests');
};
# ...so we apply a "before" modifier to each test run, calling the clearer on
# the counter. When next accessed, it will re-initialize to zero. We could
# call any other code we want here, and we can compose numerous modifiers
# together onto run_test.
#
# If you want to clear *all* the object state between each test... you probably
# want to refactor.
before run_test => sub { $_[0]->clear_counter };
run_me;
done_testing;
Test 000755 000765 000024 0 15154420551 14714 5 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/lib Routine.pm 100644 000765 000024 44424 15154420551 17067 0 ustar 00rjbs staff 000000 000000 Test-Routine-0.032/lib/Test use v5.12.0;
use warnings;
package Test::Routine 0.032;
# ABSTRACT: composable units of assertion
#pod =head1 SYNOPSIS
#pod
#pod # mytest.t
#pod use Test::More;
#pod use Test::Routine;
#pod use Test::Routine::Util;
#pod
#pod has fixture => (
#pod is => 'ro',
#pod lazy => 1,
#pod clearer => 'reset_fixture',
#pod default => sub { ...expensive setup... },
#pod );
#pod
#pod test "we can use our fixture to do stuff" => sub {
#pod my ($self) = @_;
#pod
#pod $self->reset_fixture; # this test requires a fresh one
#pod
#pod ok( $self->fixture->do_things, "do_things returns true");
#pod ok( ! $self->fixture->no_op, "no_op returns false");
#pod
#pod for my $item ($self->fixture->contents) {
#pod isa_ok($item, 'Fixture::Entry');
#pod }
#pod };
#pod
#pod test "fixture was recycled" => sub {
#pod my ($self) = @_;
#pod
#pod my $fixture = $self->fixture; # we don't expect a fresh one
#pod
#pod is( $self->fixture->things_done, 1, "we have done one thing already");
#pod };
#pod
#pod run_me;
#pod done_testing;
#pod
#pod =head1 DESCRIPTION
#pod
#pod Test::Routine is a very simple framework for writing your tests as composable
#pod units of assertion. In other words: roles.
#pod
#pod For a walkthrough of tests written with Test::Routine, see
#pod L.
#pod
#pod Test::Routine is similar to L in some ways. These similarities
#pod are largely superficial, but the idea of "tests bound together in reusable
#pod units" is a useful one to understand when coming to Test::Routine. If you are
#pod already familiar with Test::Class, it is the differences rather than the
#pod similarities that will be more important to understand. If you are not
#pod familiar with Test::Class, there is no need to understand it prior to using
#pod Test::Routine.
#pod
#pod On the other hand, an understanding of the basics of L is absolutely
#pod essential. Test::Routine composes tests from Moose classes, roles, and
#pod attributes. Without an understanding of those, you will not be able to use
#pod Test::Routine. The L is an excellent resource for learning
#pod Moose, and has links to other online tutorials and documentation.
#pod
#pod =head2 The Concepts
#pod
#pod =head2 The Basics of Using Test::Routine
#pod
#pod There actually isn't much to Test::Routine I than the basics. It does
#pod not provide many complex features, instead delegating almost everything to the
#pod Moose object system.
#pod
#pod =head3 Writing Tests
#pod
#pod To write a set of tests (a test routine, which is a role), you add C