File Coverage

blib/lib/Test/CompanionClasses/Base.pm
Criterion Covered Total %
statement 31 31 100.0
branch 1 2 50.0
condition n/a
subroutine 11 11 100.0
pod 3 3 100.0
total 46 47 97.8


line stmt bran cond sub pod time code
1 1     1   636 use 5.008;
  1         5  
  1         38  
2 1     1   5 use strict;
  1         2  
  1         28  
3 1     1   4 use warnings;
  1         2  
  1         48  
4              
5             package Test::CompanionClasses::Base;
6             BEGIN {
7 1     1   15 $Test::CompanionClasses::Base::VERSION = '1.101370';
8             }
9             # ABSTRACT: Base class for test companion classes
10 1     1   5 use Test::More;
  1         3  
  1         6  
11 1     1   260 use UNIVERSAL::require;
  1         2  
  1         9  
12 1         6 use parent qw(
13             Class::Accessor::Complex
14             Data::Inherited
15 1     1   28 );
  1         3  
16             __PACKAGE__
17             ->mk_new
18             ->mk_scalar_accessors(qw(package));
19 1     1   5434 use constant PLAN => 0; # default
  1         4  
  1         235  
20              
21             sub make_real_object {
22 1     1 1 2 my ($self, @args) = @_;
23 1         4 $self->package->require;
24 1 50       44 die $@ if $@;
25 1         4 $self->package->new(@args);
26             }
27 1     1 1 5 sub run { }
28              
29             # this can be called as a class method as well
30             sub planned_test_count {
31 1     1 1 3 my $self = shift;
32 1         2 my $plan = 0;
33 1         12 $plan += $_ for $self->every_list('PLAN');
34 1         269 $plan;
35             }
36             1;
37              
38              
39             __END__