Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More tests => 2; | ||
use Dancer::FileUtils 'path'; | ||
|
||
use Dancer::Template::HtmlTemplate; | ||
|
||
my $engine; | ||
eval { $engine = Dancer::Template::HtmlTemplate->new }; | ||
is $@, '', | ||
"Dancer::Template::HtmlTemplate engine created"; | ||
|
||
my $template = path('t', 'index.tt'); | ||
my $result = $engine->render( | ||
$template, | ||
{ var1 => 1, | ||
var2 => 2, | ||
foo => 'one', | ||
bar => 'two', | ||
baz => 'three' | ||
} | ||
); | ||
|
||
my $expected = | ||
'this is var1="1" and var2=2' . "\n\nanother line\n\none two three\n"; | ||
is $result, $expected, "processed a template given as a file name"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
this is var1="<TMPL_VAR NAME=var1 >" and var2=<TMPL_VAR NAME= var2 > | ||
|
||
another line | ||
|
||
<TMPL_VAR NAME=foo> <TMPL_VAR NAME=bar> <TMPL_VAR NAME=baz> |