Skip to content

Commit

Permalink
Test cases for handlebars-lang#599
Browse files Browse the repository at this point in the history
  • Loading branch information
laurie71 committed Aug 28, 2013
1 parent 7ec25f3 commit 03ef3d4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (-)");
Expand Down

0 comments on commit 03ef3d4

Please sign in to comment.