summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-05 11:48:54 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-05 11:52:55 -0500
commitd6ad2d3c6ee63fc8493b47e4f4b82e1804bfac5f (patch)
tree12477aa52988a5873aeb774d9af92bd695498bf1 /t
parent4954d01527cc7f33dfd906faf2f1941d63055c4c (diff)
downloadtext-handlebars-d6ad2d3c6ee63fc8493b47e4f4b82e1804bfac5f.tar.gz
text-handlebars-d6ad2d3c6ee63fc8493b47e4f4b82e1804bfac5f.zip
support {{@index}}
Diffstat (limited to 't')
-rw-r--r--t/blocks.t14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/blocks.t b/t/blocks.t
index 7cc68fe..8b44e9d 100644
--- a/t/blocks.t
+++ b/t/blocks.t
@@ -47,4 +47,18 @@ render_ok(
"nested array of hashes block variable"
);
+render_ok(
+ '{{#goodbyes}}{{@index}}. {{text}}! {{/goodbyes}}cruel {{world}}!',
+ {
+ goodbyes => [
+ { text => 'goodbye' },
+ { text => 'Goodbye' },
+ { text => 'GOODBYE' },
+ ],
+ world => 'world',
+ },
+ '0. goodbye! 1. Goodbye! 2. GOODBYE! cruel world!',
+ "\@index variable"
+);
+
done_testing;