File Coverage

blib/lib/Mason/t/Defer.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 24 25 96.0


line stmt bran cond sub pod time code
1             package Mason::t::Defer;
2             $Mason::t::Defer::VERSION = '2.23';
3 1     1   1325 use Test::More;
  1         27900  
  1         15  
4 1     1   363 use strict;
  1         2  
  1         35  
5 1     1   3 use warnings;
  1         2  
  1         37  
6 1     1   3 use base qw(Mason::Test::Class);
  1         1  
  1         571  
7              
8             sub test_defer : Test(1) {
9 1     1 0 1700 my $self = shift;
10 1         16 $self->{interp} = $self->create_interp( plugins => [ '@Default', 'Defer' ] );
11 1         43 $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 1     1   15 }
  1         2  
  1         9  
35              
36             1;