File Coverage

blib/lib/Modulino/TestWithBase.pm
Criterion Covered Total %
statement 11 19 57.8
branch n/a
condition n/a
subroutine 4 6 66.6
pod 1 1 100.0
total 16 26 61.5


line stmt bran cond sub pod time code
1 1     1   929 use v5.14;
  1         3  
2              
3             package Modulino::TestWithBase;
4 1     1   5 use utf8;
  1         2  
  1         9  
5 1     1   24 use strict;
  1         2  
  1         18  
6 1     1   4 use warnings;
  1         2  
  1         170  
7              
8             our $VERSION = '1.003';
9              
10             require Modulino::Base;
11              
12             =encoding utf8
13              
14             =head1 NAME
15              
16             Modulino::TestWithBase - A demonstration of module ideas
17              
18             =head1 SYNOPSIS
19              
20             This module isn't meant for use. It's an example of the modulino idea
21             with an additional branch to recognize test situations then run as a
22             test file.
23              
24             =head1 DESCRIPTION
25              
26             I wrote this module as a demonstration of some ideas for I
27             Perl>'s modulino chapter. This module loads Modulino::Base to handle
28             the modulino portions of the module.
29              
30             In particular, this modulino has a special test more. If C
31             is a true value, it runs the module as a test file. That mode will
32             look for methods that start with C<_test_>.
33              
34             This also handles the normal "run as application" modulino idea if the
35              
36             =over 4
37              
38             =item run
39              
40             =cut
41              
42             sub run {
43 0     0 1   say "Running as program";
44             }
45              
46             sub _test_run {
47 0     0     require Test::More;
48              
49 0           Test::More::pass();
50 0           Test::More::pass();
51              
52             SKIP: {
53 0           Test::More::skip( "These tests don't work", 2 );
  0            
54 0           Test::More::fail();
55 0           Test::More::fail();
56             }
57             }
58              
59             =back
60              
61             =head2 Testing
62              
63             =over 4
64              
65             =item test
66              
67             Run all of the subroutines that start with C<_test_>. Each subroutine
68             is wrapped in a C subtest.
69              
70             =back
71              
72             =head1 TO DO
73              
74              
75             =head1 SEE ALSO
76              
77              
78             =head1 SOURCE AVAILABILITY
79              
80             This source is in Github:
81              
82             https://github.com/briandfoy/modulino-demo/
83              
84             =head1 AUTHOR
85              
86             brian d foy, C<< >>
87              
88             =head1 COPYRIGHT AND LICENSE
89              
90             Copyright © 2012-2021, brian d foy . All rights reserved.
91              
92             You may redistribute this under the terms of the Artistic License 2.0.
93              
94             =cut
95              
96             1;