diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/acceptance_spec.rb | 3 | ||||
-rw-r--r-- | spec/qunit_spec.js | 19 |
2 files changed, 20 insertions, 2 deletions
diff --git a/spec/acceptance_spec.rb b/spec/acceptance_spec.rb index 842722b..d896417 100644 --- a/spec/acceptance_spec.rb +++ b/spec/acceptance_spec.rb @@ -64,7 +64,8 @@ Module.new do result = js_context.eval("$$RSPEC1$$ == $$RSPEC2$$") - message ||= "#{first} did not == #{second}" + additional_message = "#{first.inspect} did not == #{second.inspect}" + message = message ? "#{message} (#{additional_message})" : additional_message unless result backtrace = js_backtrace(js_context) 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() { }); |