summaryrefslogtreecommitdiff
path: root/t/01-main.t
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-07-30 13:40:06 +0200
committerfranck cuny <franck@lumberjaph.net>2010-07-30 13:40:06 +0200
commit1745c19001c4a4595624fbe97adcfc65820ae5fe (patch)
tree6cbd69d644eaf0499516f501073f416473c84aa4 /t/01-main.t
downloaddancer-template-xslate-1745c19001c4a4595624fbe97adcfc65820ae5fe.tar.gz
initial commit
Diffstat (limited to 't/01-main.t')
-rw-r--r--t/01-main.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/01-main.t b/t/01-main.t
new file mode 100644
index 0000000..97682ed
--- /dev/null
+++ b/t/01-main.t
@@ -0,0 +1,27 @@
+use strict;
+use warnings;
+use Test::More tests => 2;
+use Dancer::FileUtils 'path';
+
+use Dancer::Template::Xslate;
+
+my $engine;
+eval { $engine = Dancer::Template::Xslate->new };
+is $@, '',
+ "Dancer::Template::Xslate engine created";
+
+my $template = path('t', 'index.xslate');
+
+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";