File Coverage

blib/lib/Mason/t/ComponentMeta.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Mason::t::ComponentMeta;
2             $Mason::t::ComponentMeta::VERSION = '2.22';
3 1     1   6671 use Test::Class::Most parent => 'Mason::Test::Class';
  1         48911  
  1         9  
4              
5             sub test_cmeta : Tests {
6             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             my $comp = shift;
12             my $source_file = $self->comp_root . '/component/meta.mc';
13             foreach my $cmeta ( $comp->cmeta, ref($comp)->cmeta ) {
14             is( $cmeta->path, '/component/meta.mc', 'path' );
15             is( $cmeta->dir_path, '/component', 'dir_path' );
16             is( $cmeta->is_top_level, 1, 'is_top_level' );
17             is( $cmeta->source_file, $source_file, 'source_file' );
18             like( $cmeta->object_file, qr|meta\.mc\.mobj|, 'object_file' );
19             }
20             my $args = $comp->args;
21             delete( $args->{_test} );
22             cmp_deeply( $args, { foo => 5, bar => [ 'baz', 7 ] } );
23             },
24             );
25             }
26              
27             1;