File Coverage

blib/lib/Data/Conveyor/Environment_TEST.pm
Criterion Covered Total %
statement 25 25 100.0
branch n/a
condition n/a
subroutine 9 9 100.0
pod 1 1 100.0
total 35 35 100.0


line stmt bran cond sub pod time code
1 1     1   264304 use 5.008;
  1         8  
  1         75  
2 1     1   9 use strict;
  1         2  
  1         43  
3 1     1   7 use warnings;
  1         1  
  1         67  
4              
5             package Data::Conveyor::Environment_TEST;
6             BEGIN {
7 1     1   30 $Data::Conveyor::Environment_TEST::VERSION = '1.103130';
8             }
9             # ABSTRACT: Stage-based conveyor-belt-like ticket handling system
10              
11 1     1   1059 use Error::Hierarchy::Test 'throws2_ok';
  1         5919  
  1         61  
12 1     1   8 use parent 'Data::Conveyor::Test';
  1         27  
  1         9  
13 1     1   58 use constant PLAN => 1;
  1         2  
  1         132  
14              
15             sub run {
16 1     1 1 3428 my $self = shift;
17 1         9 $self->SUPER::run(@_);
18 1         627 my $env = $self->make_real_object;
19 1     1   66 throws2_ok { $env->make_stage_object('foobar'); }
20 1         34 'Error::Hierarchy::Internal::ValueUndefined',
21             qr/no stage class name found for \[foobar\]/,
22             'make a stage object for a nonexistent stage';
23              
24             # We release the cache for stage class names here. The bug which prompted
25             # this is a bit involved. We ran all inline pod tests - via
26             # 00podtests.t -, and this test ran first, so $env was of ref
27             # Data::Conveyor::Environment. The above code calls
28             # make_stage_object(), which indirectly caches the stage class name
29             # results, so only ST_TXSEL is cached - since that's the only thing
30             # defined in the environment's STAGE_CLASS_NAME_HASH().
31             #
32             # The next test (from another pod test file) used the config file
33             # mechanism, which pointed to a config file from a different package,
34             # and that config file uses a different environment. However, the
35             # settings from that environment weren't seen because of the cached.
36 1         6474 $env->release_stage_class_name_hash;
37             }
38             1;
39              
40              
41             __END__