diff options
author | Peter Wagenet <peter.wagenet@gmail.com> | 2011-10-24 19:41:41 -0700 |
---|---|---|
committer | Peter Wagenet <peter.wagenet@gmail.com> | 2011-10-24 19:41:41 -0700 |
commit | 43431d2a782f02ca5b3b86fa13f114e7b3e2441e (patch) | |
tree | b868fadd2e436dbf689737de79e0a1b31ce96001 /spec/qunit_spec.js | |
parent | b36776f4c66e9cfc61ee2f3d13157de40886c6e2 (diff) | |
download | handlebars.js-43431d2a782f02ca5b3b86fa13f114e7b3e2441e.zip handlebars.js-43431d2a782f02ca5b3b86fa13f114e7b3e2441e.tar.gz handlebars.js-43431d2a782f02ca5b3b86fa13f114e7b3e2441e.tar.bz2 |
Added 'log' helper - See #97
Diffstat (limited to 'spec/qunit_spec.js')
-rw-r--r-- | spec/qunit_spec.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/qunit_spec.js b/spec/qunit_spec.js index 3e66a9b..62c76c3 100644 --- a/spec/qunit_spec.js +++ b/spec/qunit_spec.js @@ -576,7 +576,11 @@ test("Invert blocks work in knownHelpers only mode", function() { equal(result, "bar", "'bar' should === '" + result); }); -module("built-in helpers"); +var teardown; +module("built-in helpers", { + setup: function(){ teardown = null; }, + teardown: function(){ if (teardown) { teardown(); } } +}); test("with", function() { var string = "{{#with person}}{{first}} {{last}}{{/with}}"; @@ -608,6 +612,19 @@ test("each", function() { "each with array argument ignores the contents when empty"); }); +test("log", function() { + var string = "{{log blah}}" + var hash = { blah: "whee" }; + + var logArg; + var originalLog = Handlebars.log; + Handlebars.log = function(arg){ logArg = arg; } + teardown = function(){ Handlebars.log = originalLog; } + + shouldCompileTo(string, hash, "", "log should not display"); + equals("whee", logArg, "should call log with 'whee'"); +}); + test("overriding property lookup", function() { }); |