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             package Modulino::TestWithBase;
2 1     1   603 use utf8;
  1         1  
  1         7  
3 1     1   22 use strict;
  1         2  
  1         12  
4 1     1   3 use warnings;
  1         4  
  1         14  
5              
6 1     1   7 use v5.10.1;
  1         2  
7              
8             our $VERSION = '1.002';
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              
71             =head1 TO DO
72              
73              
74             =head1 SEE ALSO
75              
76              
77             =head1 SOURCE AVAILABILITY
78              
79             This source is in Github:
80              
81             https://github.com/briandfoy/modulino-demo/
82              
83             =head1 AUTHOR
84              
85             brian d foy, C<< >>
86              
87             =head1 COPYRIGHT AND LICENSE
88              
89             Copyright © 2012-2018, brian d foy . All rights reserved.
90              
91             You may redistribute this under the terms of the Artistic License 2.0.
92              
93             =cut
94              
95             1;