Moose/Report/Method.pm

filter: Statementstmt 100% 36 / 36 Branchbran 50.0% 1 / 2 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 9 / 9 Podpod 50.0% 1 / 2 totaltotal 96.1% 50 / 52 CC 3 SCAR 3.1
CC
3
Cov
98%
has_tag
2.0
plan
2.0
BEGIN
1.0
CRAP 1.4
« Moose/Role/HasTimeReport.pm ↑ Summary Moose/Role/ParameterizedInstances.pm »
1 package Test::Class::Moose::Report::Method;
2  
3 # ABSTRACT: Reporting on test methods
4  
5 30 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 30 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 30 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 30 ▶use 5.010000;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 30 our $VERSION = '1.00';
12  
13 30 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 30 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 30 ▶use Test::Class::Moose::AttributeRegistry;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 30 with qw(
18 Test::Class::Moose::Role::Reporting
19 );
20  
21 30 has test_setup_method => (
22 is => 'rw',
23 isa => 'Test::Class::Moose::Report::Method',
24 writer => 'set_test_setup_method',
25 );
26  
27 30 has test_teardown_method => (
28 is => 'rw',
29 isa => 'Test::Class::Moose::Report::Method',
30 writer => 'set_test_teardown_method',
31 );
32  
33 30 has 'instance' => (
34 is => 'ro',
35 isa => 'Test::Class::Moose::Report::Instance',
36 required => 1,
37 weak_ref => 1,
38 );
39  
40 30 has 'num_tests_run' => (
41 is => 'rw',
42 isa => 'Int',
43 default => 0,
44 );
45  
46 30 has 'tests_planned' => (
47 is => 'rw',
48 isa => 'Int',
49 predicate => 'has_plan',
50 );
51  
52 13 ▶sub plan {
Subroutine plan: called CC=2 SCAR=6.9
Pod undocumented
53 13 my ( $self, $integer ) = @_;
54 13 ▶ $self->tests_planned( ( $self->tests_planned || 0 ) + $integer );
Condition100%2/2
$self->tests_planned || 0
l!l
211
MC/DC100%1/1
$self->tests_planned || 0
$self->tests_planned
Truth table100%2/2
A
A= $self->tests_planned
Aresult
11
00
55 }
56  
57 2 ▶sub has_tag {
Subroutine has_tag: called CC=2 SCAR=7.0
Pod documented
58 2 my ( $self, $tag ) = @_;
59 2 ▶ croak('has_tag(\$tag) requires a tag name') unless defined $tag;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $tag 0 2 2
60 2 my $class = $self->instance->name;
61 2 my $method = $self->name;
62 2 return Test::Class::Moose::AttributeRegistry->method_has_tag(
63 $class,
64 $method,
65 $tag
66 );
67 }
68  
69 30 __PACKAGE__->meta->make_immutable;
70  
71 30 1;
72  
73 __END__
« Moose/Role/HasTimeReport.pm ↑ Summary Moose/Role/ParameterizedInstances.pm »