| 1 | package Test::Mojo::Role::DOMinizer; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use Mojo::Base -base; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use Role::Tiny; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | our $VERSION = '1.001002'; # VERSION | |||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | sub in_DOM { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
in_DOM: called CC=4 SCAR=14.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 2 | my ($self, $code) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | my $res = do { | |||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | local $_ = $self->tx->res->dom; | |||||||||||||||||||||||||||||||||||||||||
| 12 | 2 | $code->($_, $self); | |||||||||||||||||||||||||||||||||||||||||
| 13 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | # Don't know a better way to test whether the returned object is | ||||||||||||||||||||||||||||||||||||||||||
| 16 | # a Test::Mojo when it does arbitrary roles, so doing this hack: | ||||||||||||||||||||||||||||||||||||||||||
| 17 | 2 | my $ref = ref $res; | |||||||||||||||||||||||||||||||||||||||||
| 18 | 2 | ▶ | $ref && ( | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
$ref and $ref eq "Test::Mojo" || $ref =~ /^Test::Mojo__WITH__Test::Mojo::Role/u
$ref eq "Test::Mojo" or $ref =~ /^Test::Mojo__WITH__Test::Mojo::Role/u
MC/DC33%1/3
$ref and $ref eq "Test::Mojo" || $ref =~ /^Test::Mojo__WITH__Test::Mojo::Role/u
$ref
$ref eq "Test::Mojo"
$ref =~ /^Test::Mojo__WITH__Test::Mojo::Role/u
Truth table50%2/4
A and B or C
A= $refB= $ref eq "Test::Mojo"C= $ref =~ /^Test::Mojo__WITH__Test::Mojo::Role/u
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | $ref eq 'Test::Mojo' or $ref =~ /^Test::Mojo__WITH__Test::Mojo::Role/ | ||||||||||||||||||||||||||||||||||||||||||
| 20 | ) ? $res : $self | ||||||||||||||||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 24 | __END__ | ||||||||||||||||||||||||||||||||||||||||||