Passing/Output/Test.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 3 / 3 totaltotal 100% 36 / 36 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Passing/Output/STDERR.pm ↑ Summary Passing/Role/HasErrorChain.pm »
1 package Message::Passing::Output::Test;
2 13 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 13 ▶use MooX::Types::MooseLike::Base qw/ ArrayRef /;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 13 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 13 extends 'Message::Passing::Output::Callback';
7  
8 has '+cb' => (
9 20 ▶ default => sub { sub {} },
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
10 13 );
11  
12 has _messages => (
13 is => 'ro',
14 isa => ArrayRef,
15 30 ▶ default => sub { [] },
Subroutine __ANON__: called CC=1 SCAR=0.0
16 13 clearer => 'clear_messages',
17 lazy => 1,
18 );
19  
20 27 ▶sub messages { @{ $_[0]->_messages } }
Subroutine messages: called CC=1 SCAR=0.0
Pod documented
21 27 ▶sub consume_test { push(@{$_[0]->_messages }, $_[1]) }
Subroutine consume_test: called CC=1 SCAR=0.0
Pod documented
22 14 ▶sub message_count { scalar @{ $_[0]->_messages } }
Subroutine message_count: called CC=1 SCAR=0.0
Pod documented
23  
24  
25 27 ▶after consume => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
26 27 shift()->consume_test(@_);
27 13 };
28  
29  
30 13 1;
31  
32 =head1 NAME
33  
34 Message::Passing::Output::Test - Output for use in unit tests
35  
36 =head1 SYNOPSIS
37  
38 You only want this if you're writing tests...
39 See the current tests for examples..
40  
41 =head1 METHODS
42  
43 =head2 messages
44  
45 =head2 clear_messages
46  
47 Clears all stores messages. Useful to speed up tests by resetting the
48 instance instead of re-instantiating it.
49  
50 =head2 consume_test
51  
52 =head2 message_count
53  
54 =head1 SEE ALSO
55  
56 L<Message::Passing>
57  
58 =head1 SPONSORSHIP
59  
60 This module exists due to the wonderful people at Suretec Systems Ltd.
61 <http://www.suretecsystems.com/> who sponsored its development for its
62 VoIP division called SureVoIP <http://www.surevoip.co.uk/> for use with
63 the SureVoIP API -
64 <http://www.surevoip.co.uk/support/wiki/api_documentation>
65  
66 =head1 AUTHOR, COPYRIGHT AND LICENSE
67  
68 See L<Message::Passing>.
69  
70 =cut
« Passing/Output/STDERR.pm ↑ Summary Passing/Role/HasErrorChain.pm »