summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-04 18:43:04 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-04 18:43:38 -0500
commit3aa97f35d6a363350e2c3c41c731c93721b348ac (patch)
tree470f9ddcf14226a06b0c31361fc49d9937fb496c /t
parent8f48b142b49caf1d1e49b2124a27433fecbf5cfa (diff)
downloadtext-handlebars-3aa97f35d6a363350e2c3c41c731c93721b348ac.tar.gz
text-handlebars-3aa97f35d6a363350e2c3c41c731c93721b348ac.zip
make {{this}} an alias to {{.}} and make them work at the top level
Diffstat (limited to 't')
-rw-r--r--t/block-helper-builtins.t2
-rw-r--r--t/expressions.t16
2 files changed, 16 insertions, 2 deletions
diff --git a/t/block-helper-builtins.t b/t/block-helper-builtins.t
index 338e067..9540b27 100644
--- a/t/block-helper-builtins.t
+++ b/t/block-helper-builtins.t
@@ -32,7 +32,6 @@ RENDERED
"with helper"
);
-{ local $TODO = "unimplemented"; local $SIG{__WARN__} = sub { };
render_ok(
<<'TEMPLATE',
<ul class="people_list">
@@ -57,7 +56,6 @@ TEMPLATE
RENDERED
"each helper"
);
-}
render_ok(
<<'TEMPLATE',
diff --git a/t/expressions.t b/t/expressions.t
index 08d0894..f12022c 100644
--- a/t/expressions.t
+++ b/t/expressions.t
@@ -87,4 +87,20 @@ render_ok(
);
}
+render_ok(
+ '{{.}} {{this}}',
+ "foo",
+ "foo foo",
+ "top level current context"
+);
+
+render_ok(
+ '{{#thing}}{{.}} {{this}}{{/thing}}',
+ {
+ thing => [ "foo" ],
+ },
+ "foo foo",
+ "nested current context"
+);
+
done_testing;