Use shouldThrow helper for test asserts

This commit is contained in:
kpdecker
2013-12-23 00:35:14 -06:00
parent 3daef9d308
commit 0cf5657c43
7 changed files with 53 additions and 34 deletions
+5 -4
View File
@@ -1,3 +1,4 @@
/*global CompilerContext, Handlebars, beforeEach, shouldCompileTo */
global.handlebarsEnv = null;
beforeEach(function() {
@@ -160,9 +161,9 @@ describe("basic context", function() {
it("this keyword nested inside path", function() {
var string = "{{#hellos}}{{text/this/foo}}{{/hellos}}";
(function() {
shouldThrow(function() {
CompilerContext.compile(string);
}).should.throw(Error);
}, Error);
});
it("this keyword in helpers", function() {
@@ -181,8 +182,8 @@ describe("basic context", function() {
it("this keyword nested inside helpers param", function() {
var string = "{{#hellos}}{{foo text/this/foo}}{{/hellos}}";
(function() {
shouldThrow(function() {
CompilerContext.compile(string);
}).should.throw(Error);
}, Error);
});
});