| 1 | package Mason::t::ComponentMeta; | ||
| 2 | 1 | $Mason::t::ComponentMeta::VERSION = '2.24'; | |
| 3 | 1 | ▶ | use Test::Class::Most parent => 'Mason::Test::Class'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | ▶ | sub test_cmeta : Tests { |
|
Subroutine
test_cmeta: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 6 | 1 | my $self = shift; | |
| 7 | $self->run_test_in_comp( | ||
| 8 | path => '/component/meta.mc', | ||
| 9 | args => { foo => 5, bar => [ 'baz', 7 ] }, | ||
| 10 | 1 | ▶ | test => sub { |
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||
| 11 | 1 | my $comp = shift; | |
| 12 | 1 | my $source_file = $self->comp_root . '/component/meta.mc'; | |
| 13 | 1 | foreach my $cmeta ( $comp->cmeta, ref($comp)->cmeta ) { | |
| 14 | 2 | is( $cmeta->path, '/component/meta.mc', 'path' ); | |
| 15 | 2 | is( $cmeta->dir_path, '/component', 'dir_path' ); | |
| 16 | 2 | is( $cmeta->is_top_level, 1, 'is_top_level' ); | |
| 17 | 2 | is( $cmeta->source_file, $source_file, 'source_file' ); | |
| 18 | 2 | like( $cmeta->object_file, qr|meta\.mc\.mobj|, 'object_file' ); | |
| 19 | } | ||
| 20 | 1 | my $args = $comp->args; | |
| 21 | 1 | delete( $args->{_test} ); | |
| 22 | 1 | cmp_deeply( $args, { foo => 5, bar => [ 'baz', 7 ] } ); | |
| 23 | }, | ||
| 24 | 1 | ); | |
| 25 | 1 | ▶ | } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 26 | |||
| 27 | 1 | 1; | |