diff options
author | kpdecker <kpdecker@gmail.com> | 2015-08-13 01:50:51 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2015-08-13 01:51:17 -0500 |
commit | ea3a5a1eb6e488f8dc0189c68a6019c76ffad740 (patch) | |
tree | f86322b074f3145f40ab79d19936d7708b18b1b2 /spec/blocks.js | |
parent | 269dd492bb3ccb54516a3f7f6caba80dbaaad862 (diff) | |
download | handlebars.js-ea3a5a1eb6e488f8dc0189c68a6019c76ffad740.zip handlebars.js-ea3a5a1eb6e488f8dc0189c68a6019c76ffad740.tar.gz handlebars.js-ea3a5a1eb6e488f8dc0189c68a6019c76ffad740.tar.bz2 |
Add ignoreStandalone compiler option
Fixes #1072
Diffstat (limited to 'spec/blocks.js')
-rw-r--r-- | spec/blocks.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/blocks.js b/spec/blocks.js index 3584ed7..71c9045 100644 --- a/spec/blocks.js +++ b/spec/blocks.js @@ -125,6 +125,16 @@ describe('blocks', function() { shouldCompileTo('{{#people}}\n{{name}}\n{{^}}\n{{none}}\n{{/people}}\n', {none: 'No people'}, 'No people\n'); }); + it('block standalone else sections can be disabled', function() { + shouldCompileTo( + '{{#people}}\n{{name}}\n{{^}}\n{{none}}\n{{/people}}\n', + [{none: 'No people'}, {}, {}, {ignoreStandalone: true}], + '\nNo people\n\n'); + shouldCompileTo( + '{{#none}}\n{{.}}\n{{^}}\nFail\n{{/none}}\n', + [{none: 'No people'}, {}, {}, {ignoreStandalone: true}], + '\nNo people\n\n'); + }); it('block standalone chained else sections', function() { shouldCompileTo('{{#people}}\n{{name}}\n{{else if none}}\n{{none}}\n{{/people}}\n', {none: 'No people'}, 'No people\n'); |