blib/lib/Mason/t/ComponentMeta.pm

filter: Statementstmt 100% 3 / 3 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 100% 4 / 4 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
CRAP 1.0
« blib/lib/Mason/t/Compilation.pm ↑ Summary blib/lib/Mason/t/Defer.pm »
1 package Mason::t::ComponentMeta;
2 $Mason::t::ComponentMeta::VERSION = '2.23';
3 1 ▶use Test::Class::Most parent => 'Mason::Test::Class';
Subroutine BEGIN: called CC=1 SCAR=0.0
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;
« blib/lib/Mason/t/Compilation.pm ↑ Summary blib/lib/Mason/t/Defer.pm »