Test/PlugAuth/Plugin/Refresh.pm

filter: Statementstmt 97.8% 46 / 47 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 1 / 1 totaltotal 93.7% 60 / 64 CC 4 SCAR 6.6
CC
4
Cov
92%
run_tests
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« PlugAuth/Role/Welcome.pm ↑ Summary PlugAuth/Role/Plugin.pm »
1 package Test::PlugAuth::Plugin::Refresh;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use PlugAuth;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use Clustericious::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use Test::PlugAuth::Plugin;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use Test::Builder;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use Role::Tiny ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use base qw( Exporter );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 3 our @EXPORT = qw( run_tests );
13  
14 # ABSTRACT: Test a PlugAuth Refresh plugin for correctness
15 3 our $VERSION = '0.39'; # VERSION
16  
17  
18 3 my $Test = Test::Builder->new;
19  
20 sub run_tests
21 3 ▶{
Subroutine run_tests: called CC=4 SCAR=14.0
Pod documented
22 3 my($class) = @_;
23 3 ▶ $class = "PlugAuth::Plugin::$class" unless $class =~ /::/;
Branch: 1 branch
BranchTrueFalseTotal
unless $class =~ /::/ 3 0 3
24 3 ▶ eval qq{ use $class };
Subroutine BEGIN: called CC=1 SCAR=0.0
25 3 ▶ die $@ if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 3 3
26
27 3 $Test->plan( tests => 4);
28
29 3 my $object = eval { $class->new(Clustericious::Config->new({}), Clustericious::Config->new({}), PlugAuth->new) };
30 3 my $error = $@;
31 3 ▶ if(ref $object)
Branch: 1 branch
BranchTrueFalseTotal
if (ref $object) { } 0 3 3
32 {
33 0 $Test->ok(1, "New returns a reference");
34 }
35 else
36 {
37 3 $Test->ok(0, "New returns a reference");
38 3 $Test->diag("ERROR: $error");
39 }
40
41 3 $Test->ok( Role::Tiny::does_role($object, 'PlugAuth::Role::Plugin'), 'does Plugin');
42 3 $Test->ok( Role::Tiny::does_role($object, 'PlugAuth::Role::Refresh'), 'does Refresh');
43 3 $Test->ok( eval { $object->can('refresh') }, "can refresh");
44 };
45  
46 3 1;
47  
48 __END__
« PlugAuth/Role/Welcome.pm ↑ Summary PlugAuth/Role/Plugin.pm »