| 1 | 1 | ▶ | use 5.008; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | package Data::Conveyor::Ticket::Payload::Common_TEST; | ||
| 6 | 1 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | $Data::Conveyor::Ticket::Payload::Common_TEST::VERSION = '1.103130'; | |
| 8 | } | ||
| 9 | # ABSTRACT: Stage-based conveyor-belt-like ticket handling system | ||
| 10 | |||
| 11 | 1 | ▶ | use Test::More; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 1 | ▶ | use parent 'Data::Conveyor::Test'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | sub PLAN { | ||
| 15 | my $self = shift; | ||
| 16 | |||
| 17 | # $::delegate->TS and ->RC in numeric context return the arrayref | ||
| 18 | $::delegate->TS_COUNT + $::delegate->RC_COUNT + 4; | ||
| 19 | } | ||
| 20 | |||
| 21 | sub run { | ||
| 22 | my $self = shift; | ||
| 23 | $self->SUPER::run(@_); | ||
| 24 | my $obj = $self->make_real_object; | ||
| 25 | $self->obj_ok($obj->default_rc, 'value_ticket_rc'); | ||
| 26 | $self->obj_ok($obj->default_status, 'value_ticket_status'); | ||
| 27 | my $ticket = $self->delegate->make_obj('ticket'); | ||
| 28 | is($obj->rc($ticket), $self->delegate->RC_OK, | ||
| 29 | 'rc without exceptions is RC_OK'); | ||
| 30 | is( $obj->status($ticket), | ||
| 31 | $self->delegate->TS_RUNNING, | ||
| 32 | 'status without exceptions is TS_RUNNING' | ||
| 33 | ); | ||
| 34 | |||
| 35 | for my $rc (sort $self->delegate->RC) { | ||
| 36 | $obj->default_rc($rc); | ||
| 37 | is($obj->rc($ticket), $rc, "effect of default [$rc] on rc"); | ||
| 38 | } | ||
| 39 | for my $status (sort $self->delegate->TS) { | ||
| 40 | $obj->default_status($status); | ||
| 41 | is($obj->status($ticket), $status, | ||
| 42 | "effect of default [$status] on status"); | ||
| 43 | } | ||
| 44 | } | ||
| 45 | 1; | ||
| 46 | |||
| 47 | |||
| 48 | __END__ | ||