diff options
author | Shawn M Moore <code@sartak.org> | 2012-09-25 17:03:40 -0400 |
---|---|---|
committer | Shawn M Moore <code@sartak.org> | 2012-09-25 17:03:40 -0400 |
commit | ebb77424883ed8fc76f82d3287f990c575edc05b (patch) | |
tree | 21ff012bc225f636b11bc3819dcd7a5c326a17d2 /t/002-expressions.t | |
parent | 2c0aa1266c1cb2a889baaa74bf423abfc8728c28 (diff) | |
download | text-handlebars-ebb77424883ed8fc76f82d3287f990c575edc05b.tar.gz text-handlebars-ebb77424883ed8fc76f82d3287f990c575edc05b.zip |
Start porting http://handlebarsjs.com/expressions.html
Diffstat (limited to 't/002-expressions.t')
-rw-r--r-- | t/002-expressions.t | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/002-expressions.t b/t/002-expressions.t new file mode 100644 index 0000000..433a7fc --- /dev/null +++ b/t/002-expressions.t @@ -0,0 +1,30 @@ +use strict; +use warnings; +use Test::More; +use Text::Xslate; + +my $tx = Text::Xslate->new(syntax => 'Handlebars'); + +is( + $tx->render_string( + '<h1>{{title}}</h1>', + { title => 'Xslate rocks' }, + ), + '<h1>Xslate rocks</h1>', +); + +is( + $tx->render_string( + '<h1>{{article.title}}</h1>', + { article => { title => 'Hash references rock' } }, + ), + '<h1>Hash references rock</h1>', +); + +is( + $tx->render_string( + '<h1>{{article/title}}</h1>', + { article => { title => 'Deprecated syntax does not' } }, + ), + '<h1>Deprecated syntax does not</h1>', +); |