File: 03-capture_placeholder.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 (27 lines) | stat: -rw-r--r-- 524 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
26
27
#!perl -T

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

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

my $context = { exists => 'hello world' };

# the capture() macro
is(
	$t->render('capture.html', $context),
	"hello world\nI don't have the noexist variable.\n",
	'capture works'
);

# the placeholder() macro
is(
	$t->render('placeholder.html', $context),
	"hello world\nI don't have the noexist variable.\n",
	'placeholder works'
);

done_testing();