summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-09-27 13:55:35 -0500
committerJesse Luehrs <doy@tozt.net>2012-09-27 13:55:35 -0500
commitc4ec8e689764348f2e6d56e46b192209187033a2 (patch)
treed09077aafb4dbe8d4e810423f0ed642fd4d89c29 /t
parenta96361ab84452a83bdca37e37c5438f41c5e2be1 (diff)
downloadtext-handlebars-c4ec8e689764348f2e6d56e46b192209187033a2.tar.gz
text-handlebars-c4ec8e689764348f2e6d56e46b192209187033a2.zip
basic implementation of raw strings
Diffstat (limited to 't')
-rw-r--r--t/003-safestring.t9
1 files changed, 3 insertions, 6 deletions
diff --git a/t/003-safestring.t b/t/003-safestring.t
index 77aa7de..8e095ea 100644
--- a/t/003-safestring.t
+++ b/t/003-safestring.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
use Test::More;
-use Text::Xslate;
+use Text::Xslate 'mark_raw';
my $tx = Text::Xslate->new(syntax => 'Handlebars');
@@ -16,18 +16,15 @@ is(
is(
$tx->render_string(
'<h1>{{title}}</h1><p>{{{body}}}</p>',
- { title => 'All about <p> Tags', body => '<i>This is a post about &lt;p&gt; tags</i>' },
+ { title => 'All About <p> Tags', body => '<i>This is a post about &lt;p&gt; tags</i>' },
),
'<h1>All About &lt;p&gt; Tags</h1><p><i>This is a post about &lt;p&gt; tags</i></p>',
);
-# XXX I'm not sure what the safestring constructor should be called
-# it's effectively Handlebars::SafeString->new($str) in JS
-# maybe we can just use Text::Xslate's mark_raw directly
is(
$tx->render_string(
'<h1>{{title}}</h1><p>{{{body}}}</p>',
- { title => Handlebars::SafeString->new('All about &lt;p&gt; Tags'), body => '<i>This is a post about &lt;p&gt; tags</i>' },
+ { title => mark_raw('All About &lt;p&gt; Tags'), body => '<i>This is a post about &lt;p&gt; tags</i>' },
),
'<h1>All About &lt;p&gt; Tags</h1><p><i>This is a post about &lt;p&gt; tags</i></p>',
);