From 03ef3d42589400fcf4d4ec74d2b4675ae468c2c2 Mon Sep 17 00:00:00 2001 From: Laurie Harper Date: Wed, 28 Aug 2013 12:51:54 -0400 Subject: [PATCH] Test cases for #599 --- spec/basic.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/basic.js b/spec/basic.js index a46636cf..ed33f487 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 (-)");