diff options
author | Kevin Decker <kpdecker@gmail.com> | 2013-10-12 14:22:10 -0700 |
---|---|---|
committer | Kevin Decker <kpdecker@gmail.com> | 2013-10-12 14:22:10 -0700 |
commit | 583141de7cb61eb70eaa6b33c25f475f3048071b (patch) | |
tree | 47c419f82f2941fbde5ff5aa33a85b79d6772b4c /spec/builtins.js | |
parent | 782aae95d0b430058e2f65b8eba1621453f9055e (diff) | |
parent | 3f96319f103d1e9dc4a6de220d2a9934e00df0b6 (diff) | |
download | handlebars.js-583141de7cb61eb70eaa6b33c25f475f3048071b.zip handlebars.js-583141de7cb61eb70eaa6b33c25f475f3048071b.tar.gz handlebars.js-583141de7cb61eb70eaa6b33c25f475f3048071b.tar.bz2 |
Merge pull request #628 from wycats/es6-modules
Convert code to ES6 modules
Diffstat (limited to 'spec/builtins.js')
-rw-r--r-- | spec/builtins.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/spec/builtins.js b/spec/builtins.js index f7aa84d..c678964 100644 --- a/spec/builtins.js +++ b/spec/builtins.js @@ -1,10 +1,5 @@ /*global CompilerContext, shouldCompileTo, compileWithPartials */ describe('builtin helpers', function() { - var originalLog = Handlebars.log; - afterEach(function() { - Handlebars.log = originalLog; - }); - describe('#if', function() { it("if", function() { var string = "{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!"; @@ -49,6 +44,12 @@ describe('builtin helpers', function() { }); describe('#each', function() { + beforeEach(function() { + handlebarsEnv.registerHelper('detectDataInsideEach', function(options) { + return options.data && options.data.exclaim; + }); + }); + it("each", function() { var string = "{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!"; var hash = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"}; @@ -116,9 +117,6 @@ describe('builtin helpers', function() { equal(result, 'a!b!c!', 'should output data'); }); - Handlebars.registerHelper('detectDataInsideEach', function(options) { - return options.data && options.data.exclaim; - }); }); it("#log", function() { @@ -127,7 +125,7 @@ describe('builtin helpers', function() { var hash = { blah: "whee" }; var levelArg, logArg; - Handlebars.log = function(level, arg){ levelArg = level, logArg = arg; }; + handlebarsEnv.log = function(level, arg){ levelArg = level, logArg = arg; }; shouldCompileTo(string, hash, "", "log should not display"); equals(1, levelArg, "should call log with 1"); |