summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-01-17 19:18:53 -0600
committerkpdecker <kpdecker@gmail.com>2015-01-17 19:19:30 -0600
commitb0b522b4f81baf5ba4c190b59abd2b9cfe82bc77 (patch)
tree9aacc4a7380da2bf571d02f2d0470858f91e492c
parent3cf47abe194219e74606994377486d7d3a033ee1 (diff)
downloadhandlebars.js-b0b522b4f81baf5ba4c190b59abd2b9cfe82bc77.zip
handlebars.js-b0b522b4f81baf5ba4c190b59abd2b9cfe82bc77.tar.gz
handlebars.js-b0b522b4f81baf5ba4c190b59abd2b9cfe82bc77.tar.bz2
Add tests for partial comment whitespace control
-rw-r--r--spec/basic.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/basic.js b/spec/basic.js
index 139d6d0..3aa1007 100644
--- a/spec/basic.js
+++ b/spec/basic.js
@@ -1,4 +1,4 @@
-/*global CompilerContext, Handlebars, beforeEach, shouldCompileTo */
+/*global CompilerContext, Handlebars, beforeEach, shouldCompileTo, shouldThrow */
global.handlebarsEnv = null;
beforeEach(function() {
@@ -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() {
@@ -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");
});