summaryrefslogtreecommitdiffstats
path: root/spec/qunit_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/qunit_spec.js')
-rw-r--r--spec/qunit_spec.js19
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() {
});