2011-12-15 12:21:53 +00:00
|
|
|
/*!
|
|
|
|
* chai
|
2012-02-07 21:09:38 +00:00
|
|
|
* Copyright(c) 2011-2012 Jake Luer <jake@alogicalparadox.com>
|
2011-12-15 12:21:53 +00:00
|
|
|
* MIT Licensed
|
|
|
|
*/
|
2011-12-07 05:25:52 +00:00
|
|
|
|
2012-03-18 21:21:19 +00:00
|
|
|
var used = []
|
|
|
|
, exports = module.exports = {};
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Chai version
|
|
|
|
*/
|
2011-12-07 05:25:52 +00:00
|
|
|
|
2012-03-18 21:47:41 +00:00
|
|
|
exports.version = '0.6.0';
|
2011-12-07 05:25:52 +00:00
|
|
|
|
2012-03-18 21:21:19 +00:00
|
|
|
/*!
|
|
|
|
* Primary `Assertion` prototype
|
|
|
|
*/
|
|
|
|
|
2011-12-07 05:25:52 +00:00
|
|
|
exports.Assertion = require('./assertion');
|
2012-03-18 21:21:19 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* Assertion Error
|
|
|
|
*/
|
|
|
|
|
2011-12-15 10:54:23 +00:00
|
|
|
exports.AssertionError = require('./error');
|
|
|
|
|
2012-03-18 21:21:19 +00:00
|
|
|
/*!
|
|
|
|
* Utils for plugins (not exported)
|
|
|
|
*/
|
|
|
|
|
|
|
|
var util = require('./utils');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* # .use(function)
|
|
|
|
*
|
|
|
|
* Provides a way to extend the internals of Chai
|
|
|
|
*
|
|
|
|
* @param {Function}
|
|
|
|
* @returns {this} for chaining
|
|
|
|
* @api public
|
|
|
|
*/
|
2012-01-27 00:13:41 +00:00
|
|
|
|
|
|
|
exports.use = function (fn) {
|
2012-02-07 21:09:38 +00:00
|
|
|
if (!~used.indexOf(fn)) {
|
2012-03-18 21:21:19 +00:00
|
|
|
fn(this, util);
|
2012-02-06 16:38:14 +00:00
|
|
|
used.push(fn);
|
|
|
|
}
|
|
|
|
|
2012-01-27 00:13:41 +00:00
|
|
|
return this;
|
|
|
|
};
|
|
|
|
|
2012-03-18 21:21:19 +00:00
|
|
|
/*!
|
|
|
|
* Expect interface
|
|
|
|
*/
|
|
|
|
|
2012-01-27 00:14:08 +00:00
|
|
|
var expect = require('./interface/expect');
|
|
|
|
exports.use(expect);
|
|
|
|
|
2012-03-18 21:21:19 +00:00
|
|
|
/*!
|
|
|
|
* Should interface
|
|
|
|
*/
|
|
|
|
|
2012-01-27 00:14:08 +00:00
|
|
|
var should = require('./interface/should');
|
|
|
|
exports.use(should);
|
|
|
|
|
2012-03-18 21:21:19 +00:00
|
|
|
/*!
|
|
|
|
* Assert interface
|
|
|
|
*/
|
|
|
|
|
2012-01-27 00:14:08 +00:00
|
|
|
var assert = require('./interface/assert');
|
|
|
|
exports.use(assert);
|