Pockito/Exported.pm

filter: Statementstmt 100% 24 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod 100% 8 / 8 totaltotal 100% 44 / 44 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Pockito/Moose/Role.pm ↑ Summary
1 package Test::Pockito::Exported;
2  
3 15 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 15 ▶use Test::Pockito;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9  
10 =head1 NAME
11  
12 Test::Pockito::Exported - A version of Pockito that's more terse.
13  
14 =head1 SETUP
15  
16 =head1 SYNOPSIS
17  
18 Creates a package level $pocket object within Test::Pockito::Exported and exports subs to interact with it. Saves on typing.
19  
20 =head1 DESCRIPTION
21  
22 $pocket is handled for you. Subs are exported into your namespace that interact with it. Available to you without a reference to a Pockito object are
23  
24 =over 1
25  
26 =item * mock( @_ )
27  
28 =item * when( .. )
29  
30 =item * report_expected_calls
31  
32 =item * expected_calls
33  
34 =back
35  
36 Some calls are created to access properties such as 'go', 'warn' and the underlying Pockito object itself.
37  
38 =over 1
39  
40 =item * setup( @_ ) performs a Test::Pockito->new( @_ ) and stores the object internally.
41  
42 =item * whine sets 'warn' to 1 (on).
43  
44 =item * go sets 'go' to 1
45  
46 =item * stop sets 'stop' to 1
47  
48 =head1 DESCRIPTION
49  
50 =cut
51  
52 15 our @EXPORT =
53 qw(stop go setup whine mock when report_expected_calls expected_calls add_mock_strategy);
54 15 our @EXPORT_OK = @EXPORT;
55  
56 15 our $object = Test::Pockito->new("_Pockito");
57  
58 6 ▶sub setup { $object = Test::Pockito->new(@_); }
Subroutine setup: called CC=1 SCAR=0.0
Pod documented
59 18 ▶sub mock { $object->mock(@_) }
Subroutine mock: called CC=1 SCAR=0.0
Pod documented
60 25 ▶sub when { $object->when(@_) }
Subroutine when: called CC=1 SCAR=0.0
Pod documented
61 3 ▶sub report_expected_calls { $object->report_expected_calls(@_) }
Subroutine report_expected_calls: called CC=1 SCAR=0.0
Pod documented
62 2 ▶sub expected_calls { $object->expected_calls(@_) }
Subroutine expected_calls: called CC=1 SCAR=0.0
Pod documented
63 1 ▶sub whine { $object->{'warn'} = 1 }
Subroutine whine: called CC=1 SCAR=0.0
Pod documented
64 2 ▶sub go { $object->{'go'} = 1 }
Subroutine go: called CC=1 SCAR=0.0
Pod documented
65 1 ▶sub stop { $object->{'go'} = 0 }
Subroutine stop: called CC=1 SCAR=0.0
Pod documented
66 15 1;
« Pockito/Moose/Role.pm ↑ Summary