moved fail to primary export

This commit is contained in:
Jake Luer 2011-12-15 05:54:23 -05:00
parent 84734b43cc
commit 0a2fc7671a
2 changed files with 14 additions and 12 deletions

View file

@ -12,4 +12,14 @@ exports.should = require('./interface/should');
exports.Assertion = require('./assertion');
exports.AssertionError = require('./error');
exports.AssertionError = require('./error');
exports.fail = function (actual, expected, message, operator, stackStartFunction) {
throw new exports.AssertionError({
message: message,
actual: actual,
expected: expected,
operator: operator,
stackStartFunction: stackStartFunction
});
}

View file

@ -1,4 +1,6 @@
var fail = require('./chai').fail;
module.exports = AssertionError;
function AssertionError (options) {
@ -27,14 +29,4 @@ AssertionError.prototype.details = function() {
AssertionError.prototype.toString = function() {
return this.summary();
};
function fail(actual, expected, message, operator, stackStartFunction) {
throw new assert.AssertionError({
message: message,
actual: actual,
expected: expected,
operator: operator,
stackStartFunction: stackStartFunction
});
}
};