File: 01-nested_layouts.t

package info (click to toggle)
libtenjin-perl 1.000001-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 272 kB
  • ctags: 61
  • sloc: perl: 717; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!perl -T

use strict;
use warnings;
use Test::More;
use Tenjin;

my $t = Tenjin->new({ path => ['t/data/nested_layouts'] });
ok($t, 'Got a proper Tenjin instance');

# single-level layout
is(
	$t->render('inside_layout.html', { _content => 'fake' }),
	'<outside><inside>fake</inside></outside>',
	'Single level of layouts works'
);

# multiple-level layouts
is(
	$t->render('top.html'),
	'<outside><inside><top>content</top></inside></outside>',
	'Multiple levels of layouts work'
);

done_testing();