| 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
MC/DC100%1/1
$self->tests_planned || 0
$self->tests_planned
Truth table100%2/2
A
A= $self->tests_planned
| |||||||||||||
| 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
| |||||||||||||
| 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__ | ||||||||||||