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.24';
3 1     1   841 use Test::Class::Most parent => 'Mason::Test::Class';
  1         31516  
  1         8  
4              
5             sub test_cmeta : Tests {
6 1     1 0 659 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   1 my $comp = shift;
12 1         7 my $source_file = $self->comp_root . '/component/meta.mc';
13 1         4 foreach my $cmeta ( $comp->cmeta, ref($comp)->cmeta ) {
14 2         391 is( $cmeta->path, '/component/meta.mc', 'path' );
15 2         1151 is( $cmeta->dir_path, '/component', 'dir_path' );
16 2         747 is( $cmeta->is_top_level, 1, 'is_top_level' );
17 2         815 is( $cmeta->source_file, $source_file, 'source_file' );
18 2         741 like( $cmeta->object_file, qr|meta\.mc\.mobj|, 'object_file' );
19             }
20 1         364 my $args = $comp->args;
21 1         3 delete( $args->{_test} );
22 1         10 cmp_deeply( $args, { foo => 5, bar => [ 'baz', 7 ] } );
23             },
24 1         18 );
25 1     1   243 }
  1         1  
  1         6  
26              
27             1;