summaryrefslogtreecommitdiffstats
path: root/spec/basic.js
diff options
context:
space:
mode:
authorLaurie Harper <laurie.harper.ca@gmail.com>2013-08-28 12:51:54 -0400
committerLaurie Harper <laurie.harper.ca@gmail.com>2013-08-28 12:51:54 -0400
commit03ef3d42589400fcf4d4ec74d2b4675ae468c2c2 (patch)
treed6df65dee24bbd1e1fbba8dd22e8e8291786a6e0 /spec/basic.js
parent7ec25f364a0a23bc764078ee01ed97db9acbabcb (diff)
downloadhandlebars.js-03ef3d42589400fcf4d4ec74d2b4675ae468c2c2.zip
handlebars.js-03ef3d42589400fcf4d4ec74d2b4675ae468c2c2.tar.gz
handlebars.js-03ef3d42589400fcf4d4ec74d2b4675ae468c2c2.tar.bz2
Test cases for #599
Diffstat (limited to 'spec/basic.js')
-rw-r--r--spec/basic.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/basic.js b/spec/basic.js
index a46636c..ed33f48 100644
--- a/spec/basic.js
+++ b/spec/basic.js
@@ -83,6 +83,18 @@ describe("basic context", function() {
"Frank", "functions are called with context arguments");
});
+ it("block functions with context argument", function() {
+ shouldCompileTo("{{#awesome 1}}inner {{.}}{{/awesome}}",
+ {awesome: function(context, options) { return options.fn(context); }},
+ "inner 1", "block functions are called with context and options");
+ });
+
+ it("block functions without context argument", function() {
+ shouldCompileTo("{{#awesome}}inner{{/awesome}}",
+ {awesome: function(options) { return options.fn(this); }},
+ "inner", "block functions are called with options");
+ });
+
it("paths with hyphens", function() {
shouldCompileTo("{{foo-bar}}", {"foo-bar": "baz"}, "baz", "Paths can contain hyphens (-)");