File Coverage

blib/lib/Mason/t/ComponentMeta.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 23 24 95.8


line stmt bran cond sub pod time code
1             package Mason::t::ComponentMeta;
2             $Mason::t::ComponentMeta::VERSION = '2.23';
3 1     1   759 use Test::Class::Most parent => 'Mason::Test::Class';
  1         26690  
  1         7  
4              
5             sub test_cmeta : Tests {
6 1     1 0 1229 my $self = shift;
7             $self->run_test_in_comp(
8             path => '/component/meta.mc',
9             args => { foo => 5, bar => [ 'baz', 7 ] },
10             test => sub {
11 1     1   3 my $comp = shift;
12 1         9 my $source_file = $self->comp_root . '/component/meta.mc';
13 1         6 foreach my $cmeta ( $comp->cmeta, ref($comp)->cmeta ) {
14 2         1100 is( $cmeta->path, '/component/meta.mc', 'path' );
15 2         1950 is( $cmeta->dir_path, '/component', 'dir_path' );
16 2         1489 is( $cmeta->is_top_level, 1, 'is_top_level' );
17 2         1373 is( $cmeta->source_file, $source_file, 'source_file' );
18 2         1425 like( $cmeta->object_file, qr|meta\.mc\.mobj|, 'object_file' );
19             }
20 1         583 my $args = $comp->args;
21 1         5 delete( $args->{_test} );
22 1         14 cmp_deeply( $args, { foo => 5, bar => [ 'baz', 7 ] } );
23             },
24 1         30 );
25 1     1   440 }
  1         2  
  1         10  
26              
27             1;