Skip to content

Commit

Permalink
Add tests for partial comment whitespace control
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdecker committed Jan 18, 2015
1 parent 3cf47ab commit b0b522b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions spec/basic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global CompilerContext, Handlebars, beforeEach, shouldCompileTo */
/*global CompilerContext, Handlebars, beforeEach, shouldCompileTo, shouldThrow */
global.handlebarsEnv = null;

beforeEach(function() {
Expand Down Expand Up @@ -36,6 +36,10 @@ describe("basic context", function() {

shouldCompileTo(' {{~! comment ~}} blah', {}, 'blah');
shouldCompileTo(' {{~!-- long-comment --~}} blah', {}, 'blah');
shouldCompileTo(' {{! comment ~}} blah', {}, ' blah');
shouldCompileTo(' {{!-- long-comment --~}} blah', {}, ' blah');
shouldCompileTo(' {{~! comment}} blah', {}, ' blah');
shouldCompileTo(' {{~!-- long-comment --}} blah', {}, ' blah');
});

it("boolean", function() {
Expand Down Expand Up @@ -140,12 +144,12 @@ describe("basic context", function() {
});
it("pathed block functions without context argument", function() {
shouldCompileTo("{{#foo.awesome}}inner{{/foo.awesome}}",
{foo: {awesome: function(options) { return this; }}},
{foo: {awesome: function() { return this; }}},
"inner", "block functions are called with options");
});
it("depthed block functions without context argument", function() {
shouldCompileTo("{{#with value}}{{#../awesome}}inner{{/../awesome}}{{/with}}",
{value: true, awesome: function(options) { return this; }},
{value: true, awesome: function() { return this; }},
"inner", "block functions are called with options");
});

Expand Down

0 comments on commit b0b522b

Please sign in to comment.