From abdcf3786dde98cda0b820904192415a92dcc76d Mon Sep 17 00:00:00 2001 From: Jake Luer Date: Tue, 7 Feb 2012 17:34:55 -0500 Subject: [PATCH] Release 0.3.1 --- History.md | 5 +++++ chai.js | 8 ++++---- lib/chai.js | 2 +- package.json | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/History.md b/History.md index d7ffa3b..ee4afa3 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,9 @@ +0.3.1 / 2012-02-07 +================== + + * node 0.4.x compat + 0.3.0 / 2012-02-07 ================== diff --git a/chai.js b/chai.js index f8aa7ac..bf83ae9 100644 --- a/chai.js +++ b/chai.js @@ -841,7 +841,7 @@ Assertion.prototype.throw = function (constructor) { try { this.obj(); } catch (err) { - if (constructor && 'function' === typeof constructor) { + if (constructor && 'function' === typeof constructor && constructor.constructor != RegExp) { this.assert( err instanceof constructor && err.name == constructor.name , 'expected ' + this.inspect + ' to throw ' + constructor.name + ' but a ' + err.name + ' was thrown' @@ -850,8 +850,8 @@ Assertion.prototype.throw = function (constructor) { } else if (constructor && constructor instanceof RegExp) { this.assert( constructor.exec(err.message) - , 'expected ' + this.inspect + ' to throw error matching ' + inspect(constructor) + ' but got ' + inspect(err.message) - , 'expected ' + this.inspect + ' to throw error not matching ' + inspect(constructor) ); + , 'expected ' + this.inspect + ' to throw error matching ' + constructor + ' but got ' + inspect(err.message) + , 'expected ' + this.inspect + ' to throw error not matching ' + constructor); return this; } else { thrown = true; @@ -897,7 +897,7 @@ require.register("chai.js", function(module, exports, require){ var used = []; var exports = module.exports = {}; -exports.version = '0.3.0'; +exports.version = '0.3.1'; exports.Assertion = require('./assertion'); exports.AssertionError = require('./error'); diff --git a/lib/chai.js b/lib/chai.js index 7c89552..f44e3f7 100644 --- a/lib/chai.js +++ b/lib/chai.js @@ -7,7 +7,7 @@ var used = []; var exports = module.exports = {}; -exports.version = '0.3.0'; +exports.version = '0.3.1'; exports.Assertion = require('./assertion'); exports.AssertionError = require('./error'); diff --git a/package.json b/package.json index d2a7946..71539ca 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "chai", "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.", "keywords": [ "test", "assertion", "assert", "testing" ], - "version": "0.3.0", + "version": "0.3.1", "repository": { "type": "git", "url": "https://github.com/logicalparadox/chai"