| 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__: not 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 | after consume => sub { | ||
| 26 | 27 | ▶ | shift()->consume_test(@_); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 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 consume_test | ||
| 46 | |||
| 47 | =head2 message_count | ||
| 48 | |||
| 49 | =head1 SEE ALSO | ||
| 50 | |||
| 51 | L<Message::Passing> | ||
| 52 | |||
| 53 | =head1 SPONSORSHIP | ||
| 54 | |||
| 55 | This module exists due to the wonderful people at Suretec Systems Ltd. | ||
| 56 | <http://www.suretecsystems.com/> who sponsored its development for its | ||
| 57 | VoIP division called SureVoIP <http://www.surevoip.co.uk/> for use with | ||
| 58 | the SureVoIP API - | ||
| 59 | <http://www.surevoip.co.uk/support/wiki/api_documentation> | ||
| 60 | |||
| 61 | =head1 AUTHOR, COPYRIGHT AND LICENSE | ||
| 62 | |||
| 63 | See L<Message::Passing>. | ||
| 64 | |||
| 65 | =cut | ||