blib/lib/Mason/t/Defer.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 16 / 16 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Mason/t/ComponentMeta.pm ↑ Summary blib/lib/Mason/t/DollarDot.pm »
1 package Mason::t::Defer;
2 $Mason::t::Defer::VERSION = '2.23';
3 1 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use base qw(Mason::Test::Class);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub test_defer : Test(1) {
9 my $self = shift;
10 $self->{interp} = $self->create_interp( plugins => [ '@Default', 'Defer' ] );
11 $self->test_comp(
12 src => <<'EOF',
13 <%class>
14 my ($title, $subtitle);
15 </%class>
16  
17 Title is <% $m->defer(sub { $title }) %>
18  
19 % $.Defer {{
20 Subtitle is <% $subtitle %>
21 % }}
22  
23 <%perl>
24 $title = 'foo';
25 $subtitle = 'bar';
26 </%perl>
27 EOF
28 expect => <<'EOF',
29 Title is foo
30  
31 Subtitle is bar
32 EOF
33 );
34 }
35  
36 1;
« blib/lib/Mason/t/ComponentMeta.pm ↑ Summary blib/lib/Mason/t/DollarDot.pm »