teabag 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/assets/javascripts/teabag-mocha.js +154 -123
- data/app/assets/javascripts/teabag-qunit.js +401 -195
- data/app/assets/javascripts/teabag-teabag.js +3 -4
- data/app/assets/javascripts/teabag/mocha.coffee +1 -1
- data/app/assets/javascripts/teabag/mocha/reporters/html.coffee +1 -1
- data/app/assets/javascripts/teabag/qunit.coffee +1 -1
- data/app/assets/javascripts/teabag/qunit/reporters/html.coffee +1 -1
- data/app/assets/javascripts/teabag/teabag.coffee +1 -0
- data/lib/teabag/version.rb +1 -1
- data/spec/dummy/log/development.log +18711 -0
- data/spec/dummy/log/test.log +632 -0
- data/spec/dummy/tmp/cache/assets/C35/A30/sprockets%2F29906bf540f7d2e081088494b2554989 +0 -0
- data/spec/dummy/tmp/cache/assets/C4E/9B0/sprockets%2Fa807397434c9262c3d62da3e91152184 +0 -0
- data/spec/dummy/tmp/cache/assets/C5B/D00/sprockets%2F01f43815683089878e371a5d078d3e2c +0 -0
- data/spec/dummy/tmp/cache/assets/C72/150/sprockets%2F4194031b4b51b6422c14ac697e3455e5 +0 -0
- data/spec/dummy/tmp/cache/assets/C75/D50/sprockets%2F5302968a40e08d2c011aa38666d273f6 +0 -0
- data/spec/dummy/tmp/cache/assets/C78/F80/sprockets%2F9161622ddd251097a4ab816b8220984c +0 -0
- data/spec/dummy/tmp/cache/assets/C7C/AC0/sprockets%2F29124be1160817c61bb4878894b2ba55 +0 -0
- data/spec/dummy/tmp/cache/assets/C7D/8F0/sprockets%2Ff13d01b85f2449a4f0638ff260425906 +0 -0
- data/spec/dummy/tmp/cache/assets/C7E/E80/sprockets%2F38544f84f61bb3942d24104e39e108c4 +0 -0
- data/spec/dummy/tmp/cache/assets/C85/6E0/sprockets%2F9e583044ba9762ac39f15431ed504495 +0 -0
- data/spec/dummy/tmp/cache/assets/C8A/460/sprockets%2F77bffd9959420103906722b404ae8d59 +0 -0
- data/spec/dummy/tmp/cache/assets/C91/FA0/sprockets%2F2eb81283f5789ae91a69344552db3856 +0 -0
- data/spec/dummy/tmp/cache/assets/C97/430/sprockets%2Fc049582fd1c9178ff983323f75326f64 +0 -0
- data/spec/dummy/tmp/cache/assets/C9D/E90/sprockets%2F3045c9533f179d3e1c805d163ed002a0 +0 -0
- data/spec/dummy/tmp/cache/assets/CA3/C80/sprockets%2F00916393d1e2e947ddafa91701411a73 +0 -0
- data/spec/dummy/tmp/cache/assets/CA6/DF0/sprockets%2F7da83747ce56e49393b6b8726587f846 +0 -0
- data/spec/dummy/tmp/cache/assets/CA9/C40/sprockets%2F932b7e2cd1e067289ab51190800814df +0 -0
- data/spec/dummy/tmp/cache/assets/CAD/410/sprockets%2F651414e5c7e86f05c5108dc71626b25c +0 -0
- data/spec/dummy/tmp/cache/assets/CAF/0F0/sprockets%2F6000e67cf3f2377f860c24da7c819701 +0 -0
- data/spec/dummy/tmp/cache/assets/CB0/700/sprockets%2F006af6bf0f6b55777b03c4615c853881 +0 -0
- data/spec/dummy/tmp/cache/assets/CB1/B50/sprockets%2F44b5b96ee7652d66a217a1756431c4a8 +0 -0
- data/spec/dummy/tmp/cache/assets/CB6/120/sprockets%2F2df706e820de0f82332a613c49f47867 +0 -0
- data/spec/dummy/tmp/cache/assets/CBB/FA0/sprockets%2F74922109263bdc965b2e9567eec6d154 +0 -0
- data/spec/dummy/tmp/cache/assets/CBD/AF0/sprockets%2Fd687ec33822256e9444e8cd04f1b4873 +0 -0
- data/spec/dummy/tmp/cache/assets/CBF/630/sprockets%2F707d2db81468088470d476abff35388d +0 -0
- data/spec/dummy/tmp/cache/assets/CC2/EC0/sprockets%2F76bf80cb571ca530357f78db78167866 +0 -0
- data/spec/dummy/tmp/cache/assets/CCB/3B0/sprockets%2F9535146026add9cffa012ee220204a66 +0 -0
- data/spec/dummy/tmp/cache/assets/CCC/DB0/sprockets%2F3998958d61cda73452466f5652ed81ef +0 -0
- data/spec/dummy/tmp/cache/assets/CCE/C50/sprockets%2Fe12774c2fea852112414bb379a71f31a +0 -0
- data/spec/dummy/tmp/cache/assets/CD3/460/sprockets%2F7f3f6802b0b309ed142d0b671c9640c4 +0 -0
- data/spec/dummy/tmp/cache/assets/CD6/DD0/sprockets%2F301bd3b0e19eb866905681d03a891be3 +0 -0
- data/spec/dummy/tmp/cache/assets/CE0/090/sprockets%2F48d5d35ae87d0723318b8bc257fa2237 +0 -0
- data/spec/dummy/tmp/cache/assets/CE3/1F0/sprockets%2Fe69a515d3a9d14c669be8871012a7d07 +0 -0
- data/spec/dummy/tmp/cache/assets/CE4/190/sprockets%2F36c9ee4181433e33e07eb9748d218ae2 +0 -0
- data/spec/dummy/tmp/cache/assets/CE6/270/sprockets%2F2c98152560d18470fec8cf4c6829b4d0 +0 -0
- data/spec/dummy/tmp/cache/assets/CE6/7C0/sprockets%2Fa03a2c86ce6724be8542295e1cf24798 +0 -0
- data/spec/dummy/tmp/cache/assets/CE7/A60/sprockets%2Ff58eee249aa167d23f8220087bb46684 +0 -0
- data/spec/dummy/tmp/cache/assets/CE9/9E0/sprockets%2F135480d497ed7e4884462dc0ef0b80d7 +0 -0
- data/spec/dummy/tmp/cache/assets/CEB/680/sprockets%2F67f0794ef8c0576d5c7da34f4437305a +0 -0
- data/spec/dummy/tmp/cache/assets/CEB/B40/sprockets%2F1150bf8d912aa100a132251eefaf6045 +0 -0
- data/spec/dummy/tmp/cache/assets/CEC/360/sprockets%2F264b79dde726b36d63fee272a0609469 +0 -0
- data/spec/dummy/tmp/cache/assets/CEE/930/sprockets%2Fe196521e15fd8d33e3261d5538fe8f92 +0 -0
- data/spec/dummy/tmp/cache/assets/CEF/650/sprockets%2Fe859309c630f7637a53d381b327df8fd +0 -0
- data/spec/dummy/tmp/cache/assets/CEF/840/sprockets%2F16c7d195fa548e8343c6a4d2256ed778 +0 -0
- data/spec/dummy/tmp/cache/assets/CF1/C50/sprockets%2F57bd9ac92067ea01882feef075582758 +0 -0
- data/spec/dummy/tmp/cache/assets/CF3/3A0/sprockets%2F6571249b82eb52e7c7e035c692df9b69 +0 -0
- data/spec/dummy/tmp/cache/assets/CF3/C50/sprockets%2F892b968b622f37b988a1de81e09bf631 +0 -0
- data/spec/dummy/tmp/cache/assets/CF8/780/sprockets%2F8845b81ff27cdb57c835836c9f91a265 +0 -0
- data/spec/dummy/tmp/cache/assets/CFA/D20/sprockets%2Fb26796b39b3c5d6ed70be7989637a493 +0 -0
- data/spec/dummy/tmp/cache/assets/CFB/210/sprockets%2F9104695bfbf9a9d4b94382e6e90487a9 +0 -0
- data/spec/dummy/tmp/cache/assets/CFC/380/sprockets%2Fa7443cbd671446a589867dd5f4a4f989 +0 -0
- data/spec/dummy/tmp/cache/assets/D00/110/sprockets%2F6a6353b7723a8b21708e0fbfe04bd422 +0 -0
- data/spec/dummy/tmp/cache/assets/D00/F60/sprockets%2F42e279b52511c47d26c0adb125fd04e8 +0 -0
- data/spec/dummy/tmp/cache/assets/D02/570/sprockets%2F51fa8dc514e6256ae0836d5eb24e0312 +0 -0
- data/spec/dummy/tmp/cache/assets/D03/630/sprockets%2F5d8da32dba6a7be70426a1d554773701 +0 -0
- data/spec/dummy/tmp/cache/assets/D04/170/sprockets%2F76ab1dc02e6c7618852708a1e05a2df3 +0 -0
- data/spec/dummy/tmp/cache/assets/D04/480/sprockets%2F8bd8f10500b21d2f9d94e4cd1401c936 +0 -0
- data/spec/dummy/tmp/cache/assets/D05/8D0/sprockets%2F319f8f235f452343f1ebf03cb262d23d +0 -0
- data/spec/dummy/tmp/cache/assets/D09/BF0/sprockets%2F9e6bca5d26f50d9484385d51ba04312c +0 -0
- data/spec/dummy/tmp/cache/assets/D0B/210/sprockets%2Fb95ce127097fba0e4019f633e91b730d +0 -0
- data/spec/dummy/tmp/cache/assets/D0E/570/sprockets%2F90fe371bf8091e88a712124d9cdae260 +0 -0
- data/spec/dummy/tmp/cache/assets/D11/080/sprockets%2Fe202468befa786e2a3e7c6d5980b2333 +0 -0
- data/spec/dummy/tmp/cache/assets/D15/750/sprockets%2F8effdd3e668a4036260a3e370f3b6657 +0 -0
- data/spec/dummy/tmp/cache/assets/D17/710/sprockets%2Ffa49fb6823d466e79a195e0cd71340c5 +0 -0
- data/spec/dummy/tmp/cache/assets/D1D/560/sprockets%2F1ca784ee7ba1922465147e7f8963eae5 +0 -0
- data/spec/dummy/tmp/cache/assets/D1E/AA0/sprockets%2F5c8741a556bc955cd36e61c88582b6dc +0 -0
- data/spec/dummy/tmp/cache/assets/D22/4D0/sprockets%2Fe94f07f16b94d5cf185c48023f98f1b7 +0 -0
- data/spec/dummy/tmp/cache/assets/D2D/060/sprockets%2F545ec7a363badb5e7106e5112b53b26d +0 -0
- data/spec/dummy/tmp/cache/assets/D30/740/sprockets%2F4ac342b2e0244e90d08bac61f54f4f82 +0 -0
- data/spec/dummy/tmp/cache/assets/D31/9C0/sprockets%2Fbd102a4f5a4985c3519dd6ab0295a1c6 +0 -0
- data/spec/dummy/tmp/cache/assets/D35/7C0/sprockets%2Ff536a2606eaf7d542c0985104cb62baf +0 -0
- data/spec/dummy/tmp/cache/assets/D37/FF0/sprockets%2F96841ca4cfae32c515077f3f5fc303b2 +0 -0
- data/spec/dummy/tmp/cache/assets/D3C/840/sprockets%2Fc6202ec91d567a85bd3d46dc43ea9108 +0 -0
- data/spec/dummy/tmp/cache/assets/D44/0F0/sprockets%2Fc4d293b967c2e290deed3f3bd2271828 +0 -0
- data/spec/dummy/tmp/cache/assets/D44/E90/sprockets%2F05cfc0bf7c9938963d1d1c63248db80d +0 -0
- data/spec/dummy/tmp/cache/assets/D45/C30/sprockets%2Fcc744877558178a3adb77c441cadce70 +0 -0
- data/spec/dummy/tmp/cache/assets/D48/BA0/sprockets%2F30a5bfc94bac88df67501fc509b84694 +0 -0
- data/spec/dummy/tmp/cache/assets/D49/A10/sprockets%2Fc4656bd995a6f297c26d19b13aadb963 +0 -0
- data/spec/dummy/tmp/cache/assets/D4A/580/sprockets%2F19b8d8a9a57850de79b6c099fb2d010e +0 -0
- data/spec/dummy/tmp/cache/assets/D50/D70/sprockets%2Fe2a3e6c95b11e0801a4eebae3a026026 +0 -0
- data/spec/dummy/tmp/cache/assets/D51/400/sprockets%2Ff5e433d8a31e80985b75ce598de236be +0 -0
- data/spec/dummy/tmp/cache/assets/D54/D80/sprockets%2F631327e25ec20edc723046cdec3bb1c0 +0 -0
- data/spec/dummy/tmp/cache/assets/D5C/710/sprockets%2F9427d05cee2caa721241a25a9af1d08f +0 -0
- data/spec/dummy/tmp/cache/assets/D5C/CC0/sprockets%2Faa8bf6de211f2765b0a26f112b971f0c +0 -0
- data/spec/dummy/tmp/cache/assets/D61/1F0/sprockets%2F0c7a6176d2fc4db00bb9a74d36380fe1 +0 -0
- data/spec/dummy/tmp/cache/assets/D63/050/sprockets%2Fae26cd0ae2c0da97e49f6043b91008d5 +0 -0
- data/spec/dummy/tmp/cache/assets/D67/BC0/sprockets%2F35d2c2b45981ade5a2db2a9c7f37a615 +0 -0
- data/spec/dummy/tmp/cache/assets/D67/C20/sprockets%2F0d30bf27e5f74bbd85f313cb8d3c4623 +0 -0
- data/spec/dummy/tmp/cache/assets/D69/F90/sprockets%2F6a0795b7b38bd7e6142cd1b88211dade +0 -0
- data/spec/dummy/tmp/cache/assets/D6D/530/sprockets%2F8d52dee91bff01a8a2306d8a7c9152a9 +0 -0
- data/spec/dummy/tmp/cache/assets/D6D/DA0/sprockets%2Fac936bf40b42227a2bf9d474ae9ec149 +0 -0
- data/spec/dummy/tmp/cache/assets/D77/B30/sprockets%2F946cf2f17c7eb41037f9ee08ad67ec40 +0 -0
- data/spec/dummy/tmp/cache/assets/D78/2F0/sprockets%2F3c61f8915b8f717b1de788e6ecad122c +0 -0
- data/spec/dummy/tmp/cache/assets/D80/390/sprockets%2Fe44158f578d9ffade083a07f54eab729 +0 -0
- data/spec/dummy/tmp/cache/assets/D8C/520/sprockets%2F221cd58a042baac534d27e4cfedc1188 +0 -0
- data/spec/dummy/tmp/cache/assets/D93/BD0/sprockets%2Ff5e1b60201e08e3ddf8d3de5211f3d5e +0 -0
- data/spec/dummy/tmp/cache/assets/D9B/C20/sprockets%2F0e01606ddd95e451bc7d39ce0eeb664d +0 -0
- data/spec/dummy/tmp/cache/assets/DA0/330/sprockets%2Fcbbb4de706387d50f48a72ee6c9c1b80 +0 -0
- data/spec/dummy/tmp/cache/assets/DA5/0A0/sprockets%2F7a4b5928cec69ab65afff309a04d6b47 +0 -0
- data/spec/dummy/tmp/cache/assets/DAE/6C0/sprockets%2F77c7a8676aeefa73156c55dfcf51cc46 +0 -0
- data/spec/dummy/tmp/cache/assets/DAF/7C0/sprockets%2F8942514d59e7bffbfb33cde6fa9735c2 +0 -0
- data/spec/dummy/tmp/cache/assets/DB3/5D0/sprockets%2Fce1d4d75832c9bdeafd869f6f7b61725 +0 -0
- data/spec/dummy/tmp/cache/assets/DB3/D70/sprockets%2Fcc2f5e1f6eeb99c33881848cb1cde758 +0 -0
- data/spec/dummy/tmp/cache/assets/DB5/040/sprockets%2F9a9da5df88713663b9fbc945facca891 +0 -0
- data/spec/dummy/tmp/cache/assets/DC3/230/sprockets%2Fdf52e72eb73be91eccc60182191aed0b +0 -0
- data/spec/dummy/tmp/cache/assets/DC7/A10/sprockets%2F84a8af0fcbf401864e1ae5bf092cba94 +0 -0
- data/spec/dummy/tmp/cache/assets/DCD/EB0/sprockets%2F4f77f509126ecbced7ea2a5ab290c8d4 +0 -0
- data/spec/dummy/tmp/cache/assets/DD8/C10/sprockets%2Ffb91282efc9f16ebaf7e98e312ce0b73 +0 -0
- data/spec/dummy/tmp/cache/assets/DDB/EF0/sprockets%2Fe790bb18b64df8aa0a9fe94642a9edd8 +0 -0
- data/spec/dummy/tmp/cache/assets/DDD/A60/sprockets%2Fff948b6ffe44a3cc3d2d109a39f548fd +0 -0
- data/spec/dummy/tmp/cache/assets/DEB/110/sprockets%2F2dbdab0ce5babca645cdb5780004f875 +0 -0
- data/spec/dummy/tmp/cache/assets/DF6/0E0/sprockets%2F85b10db6e1afe643aba6d396abdd77f0 +0 -0
- data/spec/dummy/tmp/cache/assets/DF7/E10/sprockets%2F25e4253aba9a9adcefb72552fb1ff0c8 +0 -0
- data/spec/dummy/tmp/cache/assets/DF9/AD0/sprockets%2Fc700afd7cee3fe9d7ff8352b213b2c4a +0 -0
- data/spec/dummy/tmp/cache/assets/DFC/C20/sprockets%2Fd9178ad7e3b401c9fceafd64ea2b50d6 +0 -0
- data/spec/dummy/tmp/cache/assets/DFC/C30/sprockets%2Fb50a07cb30b0bd0eec8e98e5de79d65d +0 -0
- data/spec/dummy/tmp/cache/assets/E02/6E0/sprockets%2F63d6a5cdb8cefa64ef76b5c6e0fd3720 +0 -0
- data/spec/dummy/tmp/cache/assets/E08/BB0/sprockets%2Fefac99af1af28543aef6fb607faa4973 +0 -0
- data/spec/dummy/tmp/cache/assets/E0D/070/sprockets%2F0e7ef9a5978dcc6b1abce678ef836c0a +0 -0
- data/spec/dummy/tmp/cache/assets/E17/EF0/sprockets%2Fa291ad64a26afd055dfadabbdf03f154 +0 -0
- data/spec/dummy/tmp/cache/assets/E2F/790/sprockets%2F7fac280deaa7ef20a77d5c9b5b9cfc34 +0 -0
- data/spec/dummy/tmp/cache/assets/E37/9B0/sprockets%2F4defba98cf7befff81450e2b24e90b6d +0 -0
- data/spec/dummy/tmp/cache/assets/E41/250/sprockets%2F97cf8fe3d7ffaff076f655aefb36da03 +0 -0
- data/spec/dummy/tmp/cache/assets/E58/840/sprockets%2Fab7a15f76acfee8c320dd3cfc2a8c6d5 +0 -0
- data/spec/dummy/tmp/cache/assets/E64/1E0/sprockets%2F81ab4c863fbbdec8dd66afc97ebf034d +0 -0
- data/spec/dummy/tmp/cache/assets/E6E/260/sprockets%2Fd9f8ab8b91ef582cc6c99a3ba0dedfe6 +0 -0
- data/spec/dummy/tmp/cache/assets/E89/4C0/sprockets%2F68b2eedb3cde6fc01d50fead7caf8a18 +0 -0
- data/spec/dummy/tmp/cache/assets/F79/360/sprockets%2F0ce035fefee5ebdabc8efabfbdbd6ee4 +0 -0
- data/spec/javascripts/teabag/mocha/reporters/html_mspec.coffee +1 -1
- data/vendor/assets/javascripts/{mocha-1.8.1.MIT.LICENSE → mocha-1.9.1.MIT.LICENSE} +0 -0
- data/vendor/assets/javascripts/{mocha-1.8.1.js → mocha-1.9.1.js} +79 -81
- data/vendor/assets/javascripts/{qunit-1.10.0.MIT.LICENSE → qunit-1.11.0.MIT.LICENSE} +0 -0
- data/vendor/assets/javascripts/{qunit-1.10.0.js → qunit-1.11.0.js} +319 -144
- data/vendor/assets/javascripts/support/chai.js +721 -279
- data/vendor/assets/javascripts/support/jasmine-jquery.js +28 -2
- data/vendor/assets/javascripts/support/sinon.js +581 -435
- metadata +26 -8
@@ -1,69 +1,213 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
1
|
+
;(function(){
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Require the given path.
|
5
|
+
*
|
6
|
+
* @param {String} path
|
7
|
+
* @return {Object} exports
|
8
|
+
* @api public
|
9
|
+
*/
|
10
|
+
|
11
|
+
function require(path, parent, orig) {
|
12
|
+
var resolved = require.resolve(path);
|
13
|
+
|
14
|
+
// lookup failed
|
15
|
+
if (null == resolved) {
|
16
|
+
orig = orig || path;
|
17
|
+
parent = parent || 'root';
|
18
|
+
var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
|
19
|
+
err.path = orig;
|
20
|
+
err.parent = parent;
|
21
|
+
err.require = true;
|
22
|
+
throw err;
|
23
|
+
}
|
24
|
+
|
25
|
+
var module = require.modules[resolved];
|
26
|
+
|
27
|
+
// perform real require()
|
28
|
+
// by invoking the module's
|
29
|
+
// registered function
|
30
|
+
if (!module.exports) {
|
31
|
+
module.exports = {};
|
32
|
+
module.client = module.component = true;
|
33
|
+
module.call(this, module.exports, require.relative(resolved), module);
|
20
34
|
}
|
21
|
-
|
35
|
+
|
36
|
+
return module.exports;
|
22
37
|
}
|
23
38
|
|
39
|
+
/**
|
40
|
+
* Registered modules.
|
41
|
+
*/
|
42
|
+
|
24
43
|
require.modules = {};
|
25
44
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
45
|
+
/**
|
46
|
+
* Registered aliases.
|
47
|
+
*/
|
48
|
+
|
49
|
+
require.aliases = {};
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Resolve `path`.
|
53
|
+
*
|
54
|
+
* Lookup:
|
55
|
+
*
|
56
|
+
* - PATH/index.js
|
57
|
+
* - PATH.js
|
58
|
+
* - PATH
|
59
|
+
*
|
60
|
+
* @param {String} path
|
61
|
+
* @return {String} path or null
|
62
|
+
* @api private
|
63
|
+
*/
|
64
|
+
|
65
|
+
require.resolve = function(path) {
|
66
|
+
if (path.charAt(0) === '/') path = path.slice(1);
|
67
|
+
var index = path + '/index.js';
|
68
|
+
|
69
|
+
var paths = [
|
70
|
+
path,
|
71
|
+
path + '.js',
|
72
|
+
path + '.json',
|
73
|
+
path + '/index.js',
|
74
|
+
path + '/index.json'
|
75
|
+
];
|
76
|
+
|
77
|
+
for (var i = 0; i < paths.length; i++) {
|
78
|
+
var path = paths[i];
|
79
|
+
if (require.modules.hasOwnProperty(path)) return path;
|
80
|
+
}
|
34
81
|
|
35
|
-
|
36
|
-
|
82
|
+
if (require.aliases.hasOwnProperty(index)) {
|
83
|
+
return require.aliases[index];
|
84
|
+
}
|
37
85
|
};
|
38
86
|
|
39
|
-
|
40
|
-
|
41
|
-
|
87
|
+
/**
|
88
|
+
* Normalize `path` relative to the current path.
|
89
|
+
*
|
90
|
+
* @param {String} curr
|
91
|
+
* @param {String} path
|
92
|
+
* @return {String}
|
93
|
+
* @api private
|
94
|
+
*/
|
42
95
|
|
43
|
-
|
44
|
-
|
45
|
-
path.pop();
|
96
|
+
require.normalize = function(curr, path) {
|
97
|
+
var segs = [];
|
46
98
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
99
|
+
if ('.' != path.charAt(0)) return path;
|
100
|
+
|
101
|
+
curr = curr.split('/');
|
102
|
+
path = path.split('/');
|
103
|
+
|
104
|
+
for (var i = 0; i < path.length; ++i) {
|
105
|
+
if ('..' == path[i]) {
|
106
|
+
curr.pop();
|
107
|
+
} else if ('.' != path[i] && '' != path[i]) {
|
108
|
+
segs.push(path[i]);
|
51
109
|
}
|
110
|
+
}
|
52
111
|
|
53
|
-
|
54
|
-
|
112
|
+
return curr.concat(segs).join('/');
|
113
|
+
};
|
114
|
+
|
115
|
+
/**
|
116
|
+
* Register module at `path` with callback `definition`.
|
117
|
+
*
|
118
|
+
* @param {String} path
|
119
|
+
* @param {Function} definition
|
120
|
+
* @api private
|
121
|
+
*/
|
122
|
+
|
123
|
+
require.register = function(path, definition) {
|
124
|
+
require.modules[path] = definition;
|
55
125
|
};
|
56
126
|
|
57
|
-
|
58
|
-
|
59
|
-
|
127
|
+
/**
|
128
|
+
* Alias a module definition.
|
129
|
+
*
|
130
|
+
* @param {String} from
|
131
|
+
* @param {String} to
|
132
|
+
* @api private
|
133
|
+
*/
|
134
|
+
|
135
|
+
require.alias = function(from, to) {
|
136
|
+
if (!require.modules.hasOwnProperty(from)) {
|
137
|
+
throw new Error('Failed to alias "' + from + '", it does not exist');
|
138
|
+
}
|
139
|
+
require.aliases[to] = from;
|
60
140
|
};
|
61
141
|
|
142
|
+
/**
|
143
|
+
* Return a require function relative to the `parent` path.
|
144
|
+
*
|
145
|
+
* @param {String} parent
|
146
|
+
* @return {Function}
|
147
|
+
* @api private
|
148
|
+
*/
|
149
|
+
|
150
|
+
require.relative = function(parent) {
|
151
|
+
var p = require.normalize(parent, '..');
|
152
|
+
|
153
|
+
/**
|
154
|
+
* lastIndexOf helper.
|
155
|
+
*/
|
156
|
+
|
157
|
+
function lastIndexOf(arr, obj) {
|
158
|
+
var i = arr.length;
|
159
|
+
while (i--) {
|
160
|
+
if (arr[i] === obj) return i;
|
161
|
+
}
|
162
|
+
return -1;
|
163
|
+
}
|
164
|
+
|
165
|
+
/**
|
166
|
+
* The relative require() itself.
|
167
|
+
*/
|
168
|
+
|
169
|
+
function localRequire(path) {
|
170
|
+
var resolved = localRequire.resolve(path);
|
171
|
+
return require(resolved, parent, path);
|
172
|
+
}
|
173
|
+
|
174
|
+
/**
|
175
|
+
* Resolve relative to the parent.
|
176
|
+
*/
|
177
|
+
|
178
|
+
localRequire.resolve = function(path) {
|
179
|
+
var c = path.charAt(0);
|
180
|
+
if ('/' == c) return path.slice(1);
|
181
|
+
if ('.' == c) return require.normalize(p, path);
|
182
|
+
|
183
|
+
// resolve deps by returning
|
184
|
+
// the dep in the nearest "deps"
|
185
|
+
// directory
|
186
|
+
var segs = parent.split('/');
|
187
|
+
var i = lastIndexOf(segs, 'deps') + 1;
|
188
|
+
if (!i) i = 0;
|
189
|
+
path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
|
190
|
+
return path;
|
191
|
+
};
|
192
|
+
|
193
|
+
/**
|
194
|
+
* Check if module is defined at `path`.
|
195
|
+
*/
|
196
|
+
|
197
|
+
localRequire.exists = function(path) {
|
198
|
+
return require.modules.hasOwnProperty(localRequire.resolve(path));
|
199
|
+
};
|
200
|
+
|
201
|
+
return localRequire;
|
202
|
+
};
|
203
|
+
require.register("chai/index.js", function(exports, require, module){
|
204
|
+
module.exports = require('./lib/chai');
|
62
205
|
|
63
|
-
|
206
|
+
});
|
207
|
+
require.register("chai/lib/chai.js", function(exports, require, module){
|
64
208
|
/*!
|
65
209
|
* chai
|
66
|
-
* Copyright(c) 2011-
|
210
|
+
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
|
67
211
|
* MIT Licensed
|
68
212
|
*/
|
69
213
|
|
@@ -74,7 +218,7 @@
|
|
74
218
|
* Chai version
|
75
219
|
*/
|
76
220
|
|
77
|
-
exports.version = '1.
|
221
|
+
exports.version = '1.6.0';
|
78
222
|
|
79
223
|
/*!
|
80
224
|
* Primary `Assertion` prototype
|
@@ -141,13 +285,12 @@
|
|
141
285
|
var assert = require('./chai/interface/assert');
|
142
286
|
exports.use(assert);
|
143
287
|
|
144
|
-
});
|
145
|
-
|
146
|
-
require.register("chai/assertion.js", function(module, exports, require){
|
288
|
+
});
|
289
|
+
require.register("chai/lib/chai/assertion.js", function(exports, require, module){
|
147
290
|
/*!
|
148
291
|
* chai
|
149
292
|
* http://chaijs.com
|
150
|
-
* Copyright(c) 2011-
|
293
|
+
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
|
151
294
|
* MIT Licensed
|
152
295
|
*/
|
153
296
|
|
@@ -194,6 +337,20 @@
|
|
194
337
|
|
195
338
|
Assertion.includeStack = false;
|
196
339
|
|
340
|
+
/*!
|
341
|
+
* ### Assertion.showDiff
|
342
|
+
*
|
343
|
+
* User configurable property, influences whether or not
|
344
|
+
* the `showDiff` flag should be included in the thrown
|
345
|
+
* AssertionErrors. `false` will always be `false`; `true`
|
346
|
+
* will be true when the assertion has requested a diff
|
347
|
+
* be shown.
|
348
|
+
*
|
349
|
+
* @api public
|
350
|
+
*/
|
351
|
+
|
352
|
+
Assertion.showDiff = true;
|
353
|
+
|
197
354
|
Assertion.addProperty = function (name, fn) {
|
198
355
|
util.addProperty(this.prototype, name, fn);
|
199
356
|
};
|
@@ -231,6 +388,7 @@
|
|
231
388
|
Assertion.prototype.assert = function (expr, msg, negateMsg, expected, _actual, showDiff) {
|
232
389
|
var ok = util.test(this, arguments);
|
233
390
|
if (true !== showDiff) showDiff = false;
|
391
|
+
if (true !== Assertion.showDiff) showDiff = false;
|
234
392
|
|
235
393
|
if (!ok) {
|
236
394
|
var msg = util.getMessage(this, arguments)
|
@@ -262,13 +420,75 @@
|
|
262
420
|
}
|
263
421
|
});
|
264
422
|
|
265
|
-
});
|
423
|
+
});
|
424
|
+
require.register("chai/lib/chai/error.js", function(exports, require, module){
|
425
|
+
/*!
|
426
|
+
* chai
|
427
|
+
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
|
428
|
+
* MIT Licensed
|
429
|
+
*/
|
266
430
|
|
267
|
-
|
431
|
+
/*!
|
432
|
+
* Main export
|
433
|
+
*/
|
434
|
+
|
435
|
+
module.exports = AssertionError;
|
436
|
+
|
437
|
+
/**
|
438
|
+
* # AssertionError (constructor)
|
439
|
+
*
|
440
|
+
* Create a new assertion error based on the Javascript
|
441
|
+
* `Error` prototype.
|
442
|
+
*
|
443
|
+
* **Options**
|
444
|
+
* - message
|
445
|
+
* - actual
|
446
|
+
* - expected
|
447
|
+
* - operator
|
448
|
+
* - startStackFunction
|
449
|
+
*
|
450
|
+
* @param {Object} options
|
451
|
+
* @api public
|
452
|
+
*/
|
453
|
+
|
454
|
+
function AssertionError (options) {
|
455
|
+
options = options || {};
|
456
|
+
this.message = options.message;
|
457
|
+
this.actual = options.actual;
|
458
|
+
this.expected = options.expected;
|
459
|
+
this.operator = options.operator;
|
460
|
+
this.showDiff = options.showDiff;
|
461
|
+
|
462
|
+
if (options.stackStartFunction && Error.captureStackTrace) {
|
463
|
+
var stackStartFunction = options.stackStartFunction;
|
464
|
+
Error.captureStackTrace(this, stackStartFunction);
|
465
|
+
}
|
466
|
+
}
|
467
|
+
|
468
|
+
/*!
|
469
|
+
* Inherit from Error
|
470
|
+
*/
|
471
|
+
|
472
|
+
AssertionError.prototype = Object.create(Error.prototype);
|
473
|
+
AssertionError.prototype.name = 'AssertionError';
|
474
|
+
AssertionError.prototype.constructor = AssertionError;
|
475
|
+
|
476
|
+
/**
|
477
|
+
* # toString()
|
478
|
+
*
|
479
|
+
* Override default to string method
|
480
|
+
*/
|
481
|
+
|
482
|
+
AssertionError.prototype.toString = function() {
|
483
|
+
return this.message;
|
484
|
+
};
|
485
|
+
|
486
|
+
});
|
487
|
+
require.register("chai/lib/chai/core/assertions.js", function(exports, require, module){
|
268
488
|
/*!
|
269
489
|
* chai
|
270
490
|
* http://chaijs.com
|
271
|
-
* Copyright(c) 2011-
|
491
|
+
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
|
272
492
|
* MIT Licensed
|
273
493
|
*/
|
274
494
|
|
@@ -297,6 +517,7 @@
|
|
297
517
|
* - with
|
298
518
|
* - at
|
299
519
|
* - of
|
520
|
+
* - same
|
300
521
|
*
|
301
522
|
* @name language chains
|
302
523
|
* @api public
|
@@ -305,7 +526,7 @@
|
|
305
526
|
[ 'to', 'be', 'been'
|
306
527
|
, 'is', 'and', 'have'
|
307
528
|
, 'with', 'that', 'at'
|
308
|
-
, 'of' ].forEach(function (chain) {
|
529
|
+
, 'of', 'same' ].forEach(function (chain) {
|
309
530
|
Assertion.addProperty(chain, function () {
|
310
531
|
return this;
|
311
532
|
});
|
@@ -352,7 +573,7 @@
|
|
352
573
|
*
|
353
574
|
* The `a` and `an` assertions are aliases that can be
|
354
575
|
* used either as language chains or to assert a value's
|
355
|
-
* type
|
576
|
+
* type.
|
356
577
|
*
|
357
578
|
* // typeof
|
358
579
|
* expect('test').to.be.a('string');
|
@@ -370,15 +591,14 @@
|
|
370
591
|
* @api public
|
371
592
|
*/
|
372
593
|
|
373
|
-
function an(type, msg) {
|
594
|
+
function an (type, msg) {
|
374
595
|
if (msg) flag(this, 'message', msg);
|
596
|
+
type = type.toLowerCase();
|
375
597
|
var obj = flag(this, 'object')
|
376
|
-
,
|
377
|
-
, klass = klassStart + type.slice(1)
|
378
|
-
, article = ~[ 'A', 'E', 'I', 'O', 'U' ].indexOf(klassStart) ? 'an ' : 'a ';
|
598
|
+
, article = ~[ 'a', 'e', 'i', 'o', 'u' ].indexOf(type.charAt(0)) ? 'an ' : 'a ';
|
379
599
|
|
380
600
|
this.assert(
|
381
|
-
|
601
|
+
type === _.type(obj)
|
382
602
|
, 'expected #{this} to be ' + article + type
|
383
603
|
, 'expected #{this} not to be ' + article + type
|
384
604
|
);
|
@@ -590,8 +810,8 @@
|
|
590
810
|
* Asserts that the target is an arguments object.
|
591
811
|
*
|
592
812
|
* function test () {
|
593
|
-
|
594
|
-
|
813
|
+
* expect(arguments).to.be.arguments;
|
814
|
+
* }
|
595
815
|
*
|
596
816
|
* @name arguments
|
597
817
|
* @alias Arguments
|
@@ -663,12 +883,13 @@
|
|
663
883
|
* expect([ 1, 2, 3 ]).to.eql([ 1, 2, 3 ]);
|
664
884
|
*
|
665
885
|
* @name eql
|
886
|
+
* @alias eqls
|
666
887
|
* @param {Mixed} value
|
667
888
|
* @param {String} message _optional_
|
668
889
|
* @api public
|
669
890
|
*/
|
670
891
|
|
671
|
-
|
892
|
+
function assertEql(obj, msg) {
|
672
893
|
if (msg) flag(this, 'message', msg);
|
673
894
|
this.assert(
|
674
895
|
_.eql(obj, flag(this, 'object'))
|
@@ -678,7 +899,10 @@
|
|
678
899
|
, this._obj
|
679
900
|
, true
|
680
901
|
);
|
681
|
-
}
|
902
|
+
}
|
903
|
+
|
904
|
+
Assertion.addMethod('eql', assertEql);
|
905
|
+
Assertion.addMethod('eqls', assertEql);
|
682
906
|
|
683
907
|
/**
|
684
908
|
* ### .above(value)
|
@@ -760,7 +984,7 @@
|
|
760
984
|
this.assert(
|
761
985
|
len >= n
|
762
986
|
, 'expected #{this} to have a length at least #{exp} but got #{act}'
|
763
|
-
, 'expected #{this} to
|
987
|
+
, 'expected #{this} to have a length below #{exp}'
|
764
988
|
, n
|
765
989
|
, len
|
766
990
|
);
|
@@ -856,7 +1080,7 @@
|
|
856
1080
|
this.assert(
|
857
1081
|
len <= n
|
858
1082
|
, 'expected #{this} to have a length at most #{exp} but got #{act}'
|
859
|
-
, 'expected #{this} to
|
1083
|
+
, 'expected #{this} to have a length above #{exp}'
|
860
1084
|
, n
|
861
1085
|
, len
|
862
1086
|
);
|
@@ -961,9 +1185,9 @@
|
|
961
1185
|
*
|
962
1186
|
* // deep referencing
|
963
1187
|
* var deepObj = {
|
964
|
-
|
965
|
-
|
966
|
-
|
1188
|
+
* green: { tea: 'matcha' }
|
1189
|
+
* , teas: [ 'chai', 'matcha', { tea: 'konacha' } ]
|
1190
|
+
* };
|
967
1191
|
|
968
1192
|
* expect(deepObj).to.have.deep.property('green.tea', 'matcha');
|
969
1193
|
* expect(deepObj).to.have.deep.property('teas[1]', 'matcha');
|
@@ -1301,35 +1525,50 @@
|
|
1301
1525
|
if (desiredError) {
|
1302
1526
|
this.assert(
|
1303
1527
|
err === desiredError
|
1304
|
-
, 'expected #{this} to throw
|
1305
|
-
, 'expected #{this} to not throw '
|
1528
|
+
, 'expected #{this} to throw #{exp} but #{act} was thrown'
|
1529
|
+
, 'expected #{this} to not throw #{exp}'
|
1530
|
+
, desiredError
|
1531
|
+
, err
|
1306
1532
|
);
|
1533
|
+
|
1307
1534
|
return this;
|
1308
1535
|
}
|
1309
1536
|
// next, check constructor
|
1310
1537
|
if (constructor) {
|
1311
1538
|
this.assert(
|
1312
1539
|
err instanceof constructor
|
1313
|
-
, 'expected #{this} to throw
|
1314
|
-
, 'expected #{this} to not throw
|
1540
|
+
, 'expected #{this} to throw #{exp} but #{act} was thrown'
|
1541
|
+
, 'expected #{this} to not throw #{exp} but #{act} was thrown'
|
1542
|
+
, name
|
1543
|
+
, err
|
1544
|
+
);
|
1545
|
+
|
1315
1546
|
if (!errMsg) return this;
|
1316
1547
|
}
|
1317
1548
|
// next, check message
|
1318
|
-
|
1549
|
+
var message = 'object' === _.type(err) && "message" in err
|
1550
|
+
? err.message
|
1551
|
+
: '' + err;
|
1552
|
+
|
1553
|
+
if ((message != null) && errMsg && errMsg instanceof RegExp) {
|
1319
1554
|
this.assert(
|
1320
|
-
errMsg.exec(
|
1321
|
-
, 'expected #{this} to throw error matching
|
1322
|
-
, 'expected #{this} to throw error not matching '
|
1555
|
+
errMsg.exec(message)
|
1556
|
+
, 'expected #{this} to throw error matching #{exp} but got #{act}'
|
1557
|
+
, 'expected #{this} to throw error not matching #{exp}'
|
1558
|
+
, errMsg
|
1559
|
+
, message
|
1323
1560
|
);
|
1561
|
+
|
1324
1562
|
return this;
|
1325
|
-
} else if (
|
1563
|
+
} else if ((message != null) && errMsg && 'string' === typeof errMsg) {
|
1326
1564
|
this.assert(
|
1327
|
-
~
|
1565
|
+
~message.indexOf(errMsg)
|
1328
1566
|
, 'expected #{this} to throw error including #{exp} but got #{act}'
|
1329
1567
|
, 'expected #{this} to throw error not including #{act}'
|
1330
1568
|
, errMsg
|
1331
|
-
,
|
1569
|
+
, message
|
1332
1570
|
);
|
1571
|
+
|
1333
1572
|
return this;
|
1334
1573
|
} else {
|
1335
1574
|
thrown = true;
|
@@ -1337,16 +1576,23 @@
|
|
1337
1576
|
}
|
1338
1577
|
}
|
1339
1578
|
|
1340
|
-
var expectedThrown = name ? name : desiredError ? _.inspect(desiredError) : 'an error';
|
1341
1579
|
var actuallyGot = ''
|
1580
|
+
, expectedThrown = name !== null
|
1581
|
+
? name
|
1582
|
+
: desiredError
|
1583
|
+
? '#{exp}' //_.inspect(desiredError)
|
1584
|
+
: 'an error';
|
1585
|
+
|
1342
1586
|
if (thrown) {
|
1343
|
-
actuallyGot = ' but
|
1587
|
+
actuallyGot = ' but #{act} was thrown'
|
1344
1588
|
}
|
1345
1589
|
|
1346
1590
|
this.assert(
|
1347
1591
|
thrown === true
|
1348
1592
|
, 'expected #{this} to throw ' + expectedThrown + actuallyGot
|
1349
1593
|
, 'expected #{this} to not throw ' + expectedThrown + actuallyGot
|
1594
|
+
, desiredError
|
1595
|
+
, thrownError
|
1350
1596
|
);
|
1351
1597
|
};
|
1352
1598
|
|
@@ -1379,7 +1625,7 @@
|
|
1379
1625
|
if (msg) flag(this, 'message', msg);
|
1380
1626
|
var obj = flag(this, 'object')
|
1381
1627
|
, itself = flag(this, 'itself')
|
1382
|
-
, context = ('function' ===
|
1628
|
+
, context = ('function' === _.type(obj) && !itself)
|
1383
1629
|
? obj.prototype[method]
|
1384
1630
|
: obj[method];
|
1385
1631
|
|
@@ -1428,8 +1674,8 @@
|
|
1428
1674
|
var obj = flag(this, 'object');
|
1429
1675
|
this.assert(
|
1430
1676
|
matcher(obj)
|
1431
|
-
, 'expected #{this} to satisfy ' + _.
|
1432
|
-
, 'expected #{this} to not satisfy' + _.
|
1677
|
+
, 'expected #{this} to satisfy ' + _.objDisplay(matcher)
|
1678
|
+
, 'expected #{this} to not satisfy' + _.objDisplay(matcher)
|
1433
1679
|
, this.negate ? false : true
|
1434
1680
|
, matcher(obj)
|
1435
1681
|
);
|
@@ -1459,78 +1705,62 @@
|
|
1459
1705
|
);
|
1460
1706
|
});
|
1461
1707
|
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
require.register("chai/error.js", function(module, exports, require){
|
1467
|
-
/*!
|
1468
|
-
* chai
|
1469
|
-
* Copyright(c) 2011-2012 Jake Luer <jake@alogicalparadox.com>
|
1470
|
-
* MIT Licensed
|
1471
|
-
*/
|
1472
|
-
|
1473
|
-
/*!
|
1474
|
-
* Main export
|
1475
|
-
*/
|
1476
|
-
|
1477
|
-
module.exports = AssertionError;
|
1478
|
-
|
1479
|
-
/**
|
1480
|
-
* # AssertionError (constructor)
|
1481
|
-
*
|
1482
|
-
* Create a new assertion error based on the Javascript
|
1483
|
-
* `Error` prototype.
|
1484
|
-
*
|
1485
|
-
* **Options**
|
1486
|
-
* - message
|
1487
|
-
* - actual
|
1488
|
-
* - expected
|
1489
|
-
* - operator
|
1490
|
-
* - startStackFunction
|
1491
|
-
*
|
1492
|
-
* @param {Object} options
|
1493
|
-
* @api public
|
1494
|
-
*/
|
1495
|
-
|
1496
|
-
function AssertionError (options) {
|
1497
|
-
options = options || {};
|
1498
|
-
this.message = options.message;
|
1499
|
-
this.actual = options.actual;
|
1500
|
-
this.expected = options.expected;
|
1501
|
-
this.operator = options.operator;
|
1502
|
-
this.showDiff = options.showDiff;
|
1503
|
-
|
1504
|
-
if (options.stackStartFunction && Error.captureStackTrace) {
|
1505
|
-
var stackStartFunction = options.stackStartFunction;
|
1506
|
-
Error.captureStackTrace(this, stackStartFunction);
|
1708
|
+
function isSubsetOf(subset, superset) {
|
1709
|
+
return subset.every(function(elem) {
|
1710
|
+
return superset.indexOf(elem) !== -1;
|
1711
|
+
})
|
1507
1712
|
}
|
1508
|
-
}
|
1509
1713
|
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1714
|
+
/**
|
1715
|
+
* ### .members
|
1716
|
+
*
|
1717
|
+
* Asserts that the target is a superset of `set`,
|
1718
|
+
* or that the target and `set` have the same members.
|
1719
|
+
*
|
1720
|
+
* expect([1, 2, 3]).to.include.members([3, 2]);
|
1721
|
+
* expect([1, 2, 3]).to.not.include.members([3, 2, 8]);
|
1722
|
+
*
|
1723
|
+
* expect([4, 2]).to.have.members([2, 4]);
|
1724
|
+
* expect([5, 2]).to.not.have.members([5, 2, 1]);
|
1725
|
+
*
|
1726
|
+
* @name members
|
1727
|
+
* @param {Array} set
|
1728
|
+
* @param {String} message _optional_
|
1729
|
+
* @api public
|
1730
|
+
*/
|
1513
1731
|
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1732
|
+
Assertion.addMethod('members', function (subset, msg) {
|
1733
|
+
if (msg) flag(this, 'message', msg);
|
1734
|
+
var obj = flag(this, 'object');
|
1517
1735
|
|
1518
|
-
|
1519
|
-
|
1520
|
-
*
|
1521
|
-
* Override default to string method
|
1522
|
-
*/
|
1736
|
+
new Assertion(obj).to.be.an('array');
|
1737
|
+
new Assertion(subset).to.be.an('array');
|
1523
1738
|
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1739
|
+
if (flag(this, 'contains')) {
|
1740
|
+
return this.assert(
|
1741
|
+
isSubsetOf(subset, obj)
|
1742
|
+
, 'expected #{this} to be a superset of #{act}'
|
1743
|
+
, 'expected #{this} to not be a superset of #{act}'
|
1744
|
+
, obj
|
1745
|
+
, subset
|
1746
|
+
);
|
1747
|
+
}
|
1527
1748
|
|
1528
|
-
|
1749
|
+
this.assert(
|
1750
|
+
isSubsetOf(obj, subset) && isSubsetOf(subset, obj)
|
1751
|
+
, 'expected #{this} to have the same members as #{act}'
|
1752
|
+
, 'expected #{this} to not have the same members as #{act}'
|
1753
|
+
, obj
|
1754
|
+
, subset
|
1755
|
+
);
|
1756
|
+
});
|
1757
|
+
};
|
1529
1758
|
|
1530
|
-
|
1759
|
+
});
|
1760
|
+
require.register("chai/lib/chai/interface/assert.js", function(exports, require, module){
|
1531
1761
|
/*!
|
1532
1762
|
* chai
|
1533
|
-
* Copyright(c) 2011-
|
1763
|
+
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
|
1534
1764
|
* MIT Licensed
|
1535
1765
|
*/
|
1536
1766
|
|
@@ -2175,6 +2405,42 @@
|
|
2175
2405
|
obj.to.include(inc);
|
2176
2406
|
} else if ('string' === typeof exp) {
|
2177
2407
|
obj.to.contain.string(inc);
|
2408
|
+
} else {
|
2409
|
+
throw new chai.AssertionError({
|
2410
|
+
message: 'expected an array or string'
|
2411
|
+
, stackStartFunction: assert.include
|
2412
|
+
});
|
2413
|
+
}
|
2414
|
+
};
|
2415
|
+
|
2416
|
+
/**
|
2417
|
+
* ### .notInclude(haystack, needle, [message])
|
2418
|
+
*
|
2419
|
+
* Asserts that `haystack` does not include `needle`. Works
|
2420
|
+
* for strings and arrays.
|
2421
|
+
*i
|
2422
|
+
* assert.notInclude('foobar', 'baz', 'string not include substring');
|
2423
|
+
* assert.notInclude([ 1, 2, 3 ], 4, 'array not include contain value');
|
2424
|
+
*
|
2425
|
+
* @name notInclude
|
2426
|
+
* @param {Array|String} haystack
|
2427
|
+
* @param {Mixed} needle
|
2428
|
+
* @param {String} message
|
2429
|
+
* @api public
|
2430
|
+
*/
|
2431
|
+
|
2432
|
+
assert.notInclude = function (exp, inc, msg) {
|
2433
|
+
var obj = new Assertion(exp, msg);
|
2434
|
+
|
2435
|
+
if (Array.isArray(exp)) {
|
2436
|
+
obj.to.not.include(inc);
|
2437
|
+
} else if ('string' === typeof exp) {
|
2438
|
+
obj.to.not.contain.string(inc);
|
2439
|
+
} else {
|
2440
|
+
throw new chai.AssertionError({
|
2441
|
+
message: 'expected an array or string'
|
2442
|
+
, stackStartFunction: assert.include
|
2443
|
+
});
|
2178
2444
|
}
|
2179
2445
|
};
|
2180
2446
|
|
@@ -2495,6 +2761,44 @@
|
|
2495
2761
|
new Assertion(act, msg).to.be.closeTo(exp, delta);
|
2496
2762
|
};
|
2497
2763
|
|
2764
|
+
/**
|
2765
|
+
* ### .sameMembers(set1, set2, [message])
|
2766
|
+
*
|
2767
|
+
* Asserts that `set1` and `set2` have the same members.
|
2768
|
+
* Order is not taken into account.
|
2769
|
+
*
|
2770
|
+
* assert.sameMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'same members');
|
2771
|
+
*
|
2772
|
+
* @name sameMembers
|
2773
|
+
* @param {Array} superset
|
2774
|
+
* @param {Array} subset
|
2775
|
+
* @param {String} message
|
2776
|
+
* @api public
|
2777
|
+
*/
|
2778
|
+
|
2779
|
+
assert.sameMembers = function (set1, set2, msg) {
|
2780
|
+
new Assertion(set1, msg).to.have.same.members(set2);
|
2781
|
+
}
|
2782
|
+
|
2783
|
+
/**
|
2784
|
+
* ### .includeMembers(superset, subset, [message])
|
2785
|
+
*
|
2786
|
+
* Asserts that `subset` is included in `superset`.
|
2787
|
+
* Order is not taken into account.
|
2788
|
+
*
|
2789
|
+
* assert.includeMembers([ 1, 2, 3 ], [ 2, 1 ], 'include members');
|
2790
|
+
*
|
2791
|
+
* @name includeMembers
|
2792
|
+
* @param {Array} superset
|
2793
|
+
* @param {Array} subset
|
2794
|
+
* @param {String} message
|
2795
|
+
* @api public
|
2796
|
+
*/
|
2797
|
+
|
2798
|
+
assert.includeMembers = function (superset, subset, msg) {
|
2799
|
+
new Assertion(superset, msg).to.include.members(subset);
|
2800
|
+
}
|
2801
|
+
|
2498
2802
|
/*!
|
2499
2803
|
* Undocumented / untested
|
2500
2804
|
*/
|
@@ -2515,12 +2819,11 @@
|
|
2515
2819
|
('Throw', 'throws');
|
2516
2820
|
};
|
2517
2821
|
|
2518
|
-
});
|
2519
|
-
|
2520
|
-
require.register("chai/interface/expect.js", function(module, exports, require){
|
2822
|
+
});
|
2823
|
+
require.register("chai/lib/chai/interface/expect.js", function(exports, require, module){
|
2521
2824
|
/*!
|
2522
2825
|
* chai
|
2523
|
-
* Copyright(c) 2011-
|
2826
|
+
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
|
2524
2827
|
* MIT Licensed
|
2525
2828
|
*/
|
2526
2829
|
|
@@ -2531,12 +2834,11 @@
|
|
2531
2834
|
};
|
2532
2835
|
|
2533
2836
|
|
2534
|
-
});
|
2535
|
-
|
2536
|
-
require.register("chai/interface/should.js", function(module, exports, require){
|
2837
|
+
});
|
2838
|
+
require.register("chai/lib/chai/interface/should.js", function(exports, require, module){
|
2537
2839
|
/*!
|
2538
2840
|
* chai
|
2539
|
-
* Copyright(c) 2011-
|
2841
|
+
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
|
2540
2842
|
* MIT Licensed
|
2541
2843
|
*/
|
2542
2844
|
|
@@ -2611,12 +2913,11 @@
|
|
2611
2913
|
chai.Should = loadShould;
|
2612
2914
|
};
|
2613
2915
|
|
2614
|
-
});
|
2615
|
-
|
2616
|
-
require.register("chai/utils/addChainableMethod.js", function(module, exports, require){
|
2916
|
+
});
|
2917
|
+
require.register("chai/lib/chai/utils/addChainableMethod.js", function(exports, require, module){
|
2617
2918
|
/*!
|
2618
2919
|
* Chai - addChainingMethod utility
|
2619
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
2920
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
2620
2921
|
* MIT Licensed
|
2621
2922
|
*/
|
2622
2923
|
|
@@ -2626,15 +2927,31 @@
|
|
2626
2927
|
|
2627
2928
|
var transferFlags = require('./transferFlags');
|
2628
2929
|
|
2930
|
+
/*!
|
2931
|
+
* Module variables
|
2932
|
+
*/
|
2933
|
+
|
2934
|
+
// Check whether `__proto__` is supported
|
2935
|
+
var hasProtoSupport = '__proto__' in Object;
|
2936
|
+
|
2937
|
+
// Without `__proto__` support, this module will need to add properties to a function.
|
2938
|
+
// However, some Function.prototype methods cannot be overwritten,
|
2939
|
+
// and there seems no easy cross-platform way to detect them (@see chaijs/chai/issues/69).
|
2940
|
+
var excludeNames = /^(?:length|name|arguments|caller)$/;
|
2941
|
+
|
2942
|
+
// Cache `Function` properties
|
2943
|
+
var call = Function.prototype.call,
|
2944
|
+
apply = Function.prototype.apply;
|
2945
|
+
|
2629
2946
|
/**
|
2630
2947
|
* ### addChainableMethod (ctx, name, method, chainingBehavior)
|
2631
2948
|
*
|
2632
2949
|
* Adds a method to an object, such that the method can also be chained.
|
2633
2950
|
*
|
2634
2951
|
* utils.addChainableMethod(chai.Assertion.prototype, 'foo', function (str) {
|
2635
|
-
|
2636
|
-
|
2637
|
-
|
2952
|
+
* var obj = utils.flag(this, 'object');
|
2953
|
+
* new chai.Assertion(obj).to.be.equal(str);
|
2954
|
+
* });
|
2638
2955
|
*
|
2639
2956
|
* Can also be accessed directly from `chai.Assertion`.
|
2640
2957
|
*
|
@@ -2667,16 +2984,24 @@
|
|
2667
2984
|
return result === undefined ? this : result;
|
2668
2985
|
};
|
2669
2986
|
|
2670
|
-
//
|
2671
|
-
|
2672
|
-
|
2673
|
-
var
|
2674
|
-
|
2675
|
-
|
2676
|
-
|
2677
|
-
|
2678
|
-
|
2679
|
-
|
2987
|
+
// Use `__proto__` if available
|
2988
|
+
if (hasProtoSupport) {
|
2989
|
+
// Inherit all properties from the object by replacing the `Function` prototype
|
2990
|
+
var prototype = assert.__proto__ = Object.create(this);
|
2991
|
+
// Restore the `call` and `apply` methods from `Function`
|
2992
|
+
prototype.call = call;
|
2993
|
+
prototype.apply = apply;
|
2994
|
+
}
|
2995
|
+
// Otherwise, redefine all properties (slow!)
|
2996
|
+
else {
|
2997
|
+
var asserterNames = Object.getOwnPropertyNames(ctx);
|
2998
|
+
asserterNames.forEach(function (asserterName) {
|
2999
|
+
if (!excludeNames.test(asserterName)) {
|
3000
|
+
var pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
|
3001
|
+
Object.defineProperty(assert, asserterName, pd);
|
3002
|
+
}
|
3003
|
+
});
|
3004
|
+
}
|
2680
3005
|
|
2681
3006
|
transferFlags(this, assert);
|
2682
3007
|
return assert;
|
@@ -2685,12 +3010,11 @@
|
|
2685
3010
|
});
|
2686
3011
|
};
|
2687
3012
|
|
2688
|
-
});
|
2689
|
-
|
2690
|
-
require.register("chai/utils/addMethod.js", function(module, exports, require){
|
3013
|
+
});
|
3014
|
+
require.register("chai/lib/chai/utils/addMethod.js", function(exports, require, module){
|
2691
3015
|
/*!
|
2692
3016
|
* Chai - addMethod utility
|
2693
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
3017
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
2694
3018
|
* MIT Licensed
|
2695
3019
|
*/
|
2696
3020
|
|
@@ -2700,9 +3024,9 @@
|
|
2700
3024
|
* Adds a method to the prototype of an object.
|
2701
3025
|
*
|
2702
3026
|
* utils.addMethod(chai.Assertion.prototype, 'foo', function (str) {
|
2703
|
-
|
2704
|
-
|
2705
|
-
|
3027
|
+
* var obj = utils.flag(this, 'object');
|
3028
|
+
* new chai.Assertion(obj).to.be.equal(str);
|
3029
|
+
* });
|
2706
3030
|
*
|
2707
3031
|
* Can also be accessed directly from `chai.Assertion`.
|
2708
3032
|
*
|
@@ -2726,12 +3050,11 @@
|
|
2726
3050
|
};
|
2727
3051
|
};
|
2728
3052
|
|
2729
|
-
});
|
2730
|
-
|
2731
|
-
require.register("chai/utils/addProperty.js", function(module, exports, require){
|
3053
|
+
});
|
3054
|
+
require.register("chai/lib/chai/utils/addProperty.js", function(exports, require, module){
|
2732
3055
|
/*!
|
2733
3056
|
* Chai - addProperty utility
|
2734
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
3057
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
2735
3058
|
* MIT Licensed
|
2736
3059
|
*/
|
2737
3060
|
|
@@ -2741,9 +3064,9 @@
|
|
2741
3064
|
* Adds a property to the prototype of an object.
|
2742
3065
|
*
|
2743
3066
|
* utils.addProperty(chai.Assertion.prototype, 'foo', function () {
|
2744
|
-
|
2745
|
-
|
2746
|
-
|
3067
|
+
* var obj = utils.flag(this, 'object');
|
3068
|
+
* new chai.Assertion(obj).to.be.instanceof(Foo);
|
3069
|
+
* });
|
2747
3070
|
*
|
2748
3071
|
* Can also be accessed directly from `chai.Assertion`.
|
2749
3072
|
*
|
@@ -2770,15 +3093,16 @@
|
|
2770
3093
|
});
|
2771
3094
|
};
|
2772
3095
|
|
2773
|
-
});
|
2774
|
-
|
2775
|
-
|
2776
|
-
|
2777
|
-
// https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/assert.js
|
3096
|
+
});
|
3097
|
+
require.register("chai/lib/chai/utils/eql.js", function(exports, require, module){
|
3098
|
+
// This is (almost) directly from Node.js assert
|
3099
|
+
// https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/assert.js
|
2778
3100
|
|
2779
3101
|
module.exports = _deepEqual;
|
2780
3102
|
|
2781
|
-
|
3103
|
+
var getEnumerableProperties = require('./getEnumerableProperties');
|
3104
|
+
|
3105
|
+
// for the browser
|
2782
3106
|
var Buffer;
|
2783
3107
|
try {
|
2784
3108
|
Buffer = require('buffer').Buffer;
|
@@ -2862,8 +3186,8 @@
|
|
2862
3186
|
return _deepEqual(a, b, memos);
|
2863
3187
|
}
|
2864
3188
|
try {
|
2865
|
-
var ka =
|
2866
|
-
kb =
|
3189
|
+
var ka = getEnumerableProperties(a),
|
3190
|
+
kb = getEnumerableProperties(b),
|
2867
3191
|
key;
|
2868
3192
|
} catch (e) {//happens when one is a string literal and the other isn't
|
2869
3193
|
return false;
|
@@ -2896,12 +3220,11 @@
|
|
2896
3220
|
return true;
|
2897
3221
|
}
|
2898
3222
|
|
2899
|
-
});
|
2900
|
-
|
2901
|
-
require.register("chai/utils/flag.js", function(module, exports, require){
|
3223
|
+
});
|
3224
|
+
require.register("chai/lib/chai/utils/flag.js", function(exports, require, module){
|
2902
3225
|
/*!
|
2903
3226
|
* Chai - flag utility
|
2904
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
3227
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
2905
3228
|
* MIT Licensed
|
2906
3229
|
*/
|
2907
3230
|
|
@@ -2932,12 +3255,11 @@
|
|
2932
3255
|
}
|
2933
3256
|
};
|
2934
3257
|
|
2935
|
-
});
|
2936
|
-
|
2937
|
-
require.register("chai/utils/getActual.js", function(module, exports, require){
|
3258
|
+
});
|
3259
|
+
require.register("chai/lib/chai/utils/getActual.js", function(exports, require, module){
|
2938
3260
|
/*!
|
2939
3261
|
* Chai - getActual utility
|
2940
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
3262
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
2941
3263
|
* MIT Licensed
|
2942
3264
|
*/
|
2943
3265
|
|
@@ -2955,12 +3277,39 @@
|
|
2955
3277
|
return 'undefined' !== typeof actual ? actual : obj._obj;
|
2956
3278
|
};
|
2957
3279
|
|
2958
|
-
});
|
3280
|
+
});
|
3281
|
+
require.register("chai/lib/chai/utils/getEnumerableProperties.js", function(exports, require, module){
|
3282
|
+
/*!
|
3283
|
+
* Chai - getEnumerableProperties utility
|
3284
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
3285
|
+
* MIT Licensed
|
3286
|
+
*/
|
3287
|
+
|
3288
|
+
/**
|
3289
|
+
* ### .getEnumerableProperties(object)
|
3290
|
+
*
|
3291
|
+
* This allows the retrieval of enumerable property names of an object,
|
3292
|
+
* inherited or not.
|
3293
|
+
*
|
3294
|
+
* @param {Object} object
|
3295
|
+
* @returns {Array}
|
3296
|
+
* @name getEnumerableProperties
|
3297
|
+
* @api public
|
3298
|
+
*/
|
3299
|
+
|
3300
|
+
module.exports = function getEnumerableProperties(object) {
|
3301
|
+
var result = [];
|
3302
|
+
for (var name in object) {
|
3303
|
+
result.push(name);
|
3304
|
+
}
|
3305
|
+
return result;
|
3306
|
+
};
|
2959
3307
|
|
2960
|
-
|
3308
|
+
});
|
3309
|
+
require.register("chai/lib/chai/utils/getMessage.js", function(exports, require, module){
|
2961
3310
|
/*!
|
2962
3311
|
* Chai - message composition utility
|
2963
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
3312
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
2964
3313
|
* MIT Licensed
|
2965
3314
|
*/
|
2966
3315
|
|
@@ -3008,12 +3357,11 @@
|
|
3008
3357
|
return flagMsg ? flagMsg + ': ' + msg : msg;
|
3009
3358
|
};
|
3010
3359
|
|
3011
|
-
});
|
3012
|
-
|
3013
|
-
require.register("chai/utils/getName.js", function(module, exports, require){
|
3360
|
+
});
|
3361
|
+
require.register("chai/lib/chai/utils/getName.js", function(exports, require, module){
|
3014
3362
|
/*!
|
3015
3363
|
* Chai - getName utility
|
3016
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
3364
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
3017
3365
|
* MIT Licensed
|
3018
3366
|
*/
|
3019
3367
|
|
@@ -3032,12 +3380,11 @@
|
|
3032
3380
|
return match && match[1] ? match[1] : "";
|
3033
3381
|
};
|
3034
3382
|
|
3035
|
-
});
|
3036
|
-
|
3037
|
-
require.register("chai/utils/getPathValue.js", function(module, exports, require){
|
3383
|
+
});
|
3384
|
+
require.register("chai/lib/chai/utils/getPathValue.js", function(exports, require, module){
|
3038
3385
|
/*!
|
3039
3386
|
* Chai - getPathValue utility
|
3040
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
3387
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
3041
3388
|
* @see https://github.com/logicalparadox/filtr
|
3042
3389
|
* MIT Licensed
|
3043
3390
|
*/
|
@@ -3049,15 +3396,15 @@
|
|
3049
3396
|
* object given a string path.
|
3050
3397
|
*
|
3051
3398
|
* var obj = {
|
3052
|
-
|
3053
|
-
|
3054
|
-
|
3055
|
-
|
3056
|
-
|
3057
|
-
|
3058
|
-
|
3059
|
-
|
3060
|
-
|
3399
|
+
* prop1: {
|
3400
|
+
* arr: ['a', 'b', 'c']
|
3401
|
+
* , str: 'Hello'
|
3402
|
+
* }
|
3403
|
+
* , prop2: {
|
3404
|
+
* arr: [ { nested: 'Universe' } ]
|
3405
|
+
* , str: 'Hello again!'
|
3406
|
+
* }
|
3407
|
+
* }
|
3061
3408
|
*
|
3062
3409
|
* The following would be the results.
|
3063
3410
|
*
|
@@ -3138,9 +3485,46 @@
|
|
3138
3485
|
return res;
|
3139
3486
|
};
|
3140
3487
|
|
3141
|
-
});
|
3488
|
+
});
|
3489
|
+
require.register("chai/lib/chai/utils/getProperties.js", function(exports, require, module){
|
3490
|
+
/*!
|
3491
|
+
* Chai - getProperties utility
|
3492
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
3493
|
+
* MIT Licensed
|
3494
|
+
*/
|
3142
3495
|
|
3143
|
-
|
3496
|
+
/**
|
3497
|
+
* ### .getProperties(object)
|
3498
|
+
*
|
3499
|
+
* This allows the retrieval of property names of an object, enumerable or not,
|
3500
|
+
* inherited or not.
|
3501
|
+
*
|
3502
|
+
* @param {Object} object
|
3503
|
+
* @returns {Array}
|
3504
|
+
* @name getProperties
|
3505
|
+
* @api public
|
3506
|
+
*/
|
3507
|
+
|
3508
|
+
module.exports = function getProperties(object) {
|
3509
|
+
var result = Object.getOwnPropertyNames(subject);
|
3510
|
+
|
3511
|
+
function addProperty(property) {
|
3512
|
+
if (result.indexOf(property) === -1) {
|
3513
|
+
result.push(property);
|
3514
|
+
}
|
3515
|
+
}
|
3516
|
+
|
3517
|
+
var proto = Object.getPrototypeOf(subject);
|
3518
|
+
while (proto !== null) {
|
3519
|
+
Object.getOwnPropertyNames(proto).forEach(addProperty);
|
3520
|
+
proto = Object.getPrototypeOf(proto);
|
3521
|
+
}
|
3522
|
+
|
3523
|
+
return result;
|
3524
|
+
};
|
3525
|
+
|
3526
|
+
});
|
3527
|
+
require.register("chai/lib/chai/utils/index.js", function(exports, require, module){
|
3144
3528
|
/*!
|
3145
3529
|
* chai
|
3146
3530
|
* Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
|
@@ -3159,6 +3543,12 @@
|
|
3159
3543
|
|
3160
3544
|
exports.test = require('./test');
|
3161
3545
|
|
3546
|
+
/*!
|
3547
|
+
* type utility
|
3548
|
+
*/
|
3549
|
+
|
3550
|
+
exports.type = require('./type');
|
3551
|
+
|
3162
3552
|
/*!
|
3163
3553
|
* message utility
|
3164
3554
|
*/
|
@@ -3244,13 +3634,14 @@
|
|
3244
3634
|
exports.addChainableMethod = require('./addChainableMethod');
|
3245
3635
|
|
3246
3636
|
|
3247
|
-
});
|
3248
|
-
|
3249
|
-
|
3250
|
-
|
3251
|
-
// https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/util.js
|
3637
|
+
});
|
3638
|
+
require.register("chai/lib/chai/utils/inspect.js", function(exports, require, module){
|
3639
|
+
// This is (almost) directly from Node.js utils
|
3640
|
+
// https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/util.js
|
3252
3641
|
|
3253
3642
|
var getName = require('./getName');
|
3643
|
+
var getProperties = require('./getProperties');
|
3644
|
+
var getEnumerableProperties = require('./getEnumerableProperties');
|
3254
3645
|
|
3255
3646
|
module.exports = inspect;
|
3256
3647
|
|
@@ -3274,7 +3665,7 @@
|
|
3274
3665
|
return formatValue(ctx, obj, (typeof depth === 'undefined' ? 2 : depth));
|
3275
3666
|
}
|
3276
3667
|
|
3277
|
-
|
3668
|
+
// https://gist.github.com/1044128/
|
3278
3669
|
var getOuterHTML = function(element) {
|
3279
3670
|
if ('outerHTML' in element) return element.outerHTML;
|
3280
3671
|
var ns = "http://www.w3.org/1999/xhtml";
|
@@ -3292,7 +3683,7 @@
|
|
3292
3683
|
}
|
3293
3684
|
};
|
3294
3685
|
|
3295
|
-
|
3686
|
+
// Returns true if object is a DOM element.
|
3296
3687
|
var isDOMElement = function (object) {
|
3297
3688
|
if (typeof HTMLElement === 'object') {
|
3298
3689
|
return object instanceof HTMLElement;
|
@@ -3327,8 +3718,8 @@
|
|
3327
3718
|
}
|
3328
3719
|
|
3329
3720
|
// Look up the keys of the object.
|
3330
|
-
var visibleKeys =
|
3331
|
-
var keys = ctx.showHidden ?
|
3721
|
+
var visibleKeys = getEnumerableProperties(value);
|
3722
|
+
var keys = ctx.showHidden ? getProperties(value) : visibleKeys;
|
3332
3723
|
|
3333
3724
|
// Some type of object without properties can be shortcutted.
|
3334
3725
|
// In IE, errors have a single `stack` property, or if they are vanilla `Error`,
|
@@ -3562,12 +3953,11 @@
|
|
3562
3953
|
return Object.prototype.toString.call(o);
|
3563
3954
|
}
|
3564
3955
|
|
3565
|
-
});
|
3566
|
-
|
3567
|
-
require.register("chai/utils/objDisplay.js", function(module, exports, require){
|
3956
|
+
});
|
3957
|
+
require.register("chai/lib/chai/utils/objDisplay.js", function(exports, require, module){
|
3568
3958
|
/*!
|
3569
3959
|
* Chai - flag utility
|
3570
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
3960
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
3571
3961
|
* MIT Licensed
|
3572
3962
|
*/
|
3573
3963
|
|
@@ -3594,7 +3984,11 @@
|
|
3594
3984
|
, type = Object.prototype.toString.call(obj);
|
3595
3985
|
|
3596
3986
|
if (str.length >= 40) {
|
3597
|
-
if (type === '[object
|
3987
|
+
if (type === '[object Function]') {
|
3988
|
+
return !obj.name || obj.name === ''
|
3989
|
+
? '[Function]'
|
3990
|
+
: '[Function: ' + obj.name + ']';
|
3991
|
+
} else if (type === '[object Array]') {
|
3598
3992
|
return '[ Array(' + obj.length + ') ]';
|
3599
3993
|
} else if (type === '[object Object]') {
|
3600
3994
|
var keys = Object.keys(obj)
|
@@ -3610,12 +4004,11 @@
|
|
3610
4004
|
}
|
3611
4005
|
};
|
3612
4006
|
|
3613
|
-
});
|
3614
|
-
|
3615
|
-
require.register("chai/utils/overwriteMethod.js", function(module, exports, require){
|
4007
|
+
});
|
4008
|
+
require.register("chai/lib/chai/utils/overwriteMethod.js", function(exports, require, module){
|
3616
4009
|
/*!
|
3617
4010
|
* Chai - overwriteMethod utility
|
3618
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
4011
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
3619
4012
|
* MIT Licensed
|
3620
4013
|
*/
|
3621
4014
|
|
@@ -3627,15 +4020,15 @@
|
|
3627
4020
|
* to be used for name.
|
3628
4021
|
*
|
3629
4022
|
* utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) {
|
3630
|
-
|
3631
|
-
|
3632
|
-
|
3633
|
-
|
3634
|
-
|
3635
|
-
|
3636
|
-
|
3637
|
-
|
3638
|
-
|
4023
|
+
* return function (str) {
|
4024
|
+
* var obj = utils.flag(this, 'object');
|
4025
|
+
* if (obj instanceof Foo) {
|
4026
|
+
* new chai.Assertion(obj.value).to.equal(str);
|
4027
|
+
* } else {
|
4028
|
+
* _super.apply(this, arguments);
|
4029
|
+
* }
|
4030
|
+
* }
|
4031
|
+
* });
|
3639
4032
|
*
|
3640
4033
|
* Can also be accessed directly from `chai.Assertion`.
|
3641
4034
|
*
|
@@ -3665,12 +4058,11 @@
|
|
3665
4058
|
}
|
3666
4059
|
};
|
3667
4060
|
|
3668
|
-
});
|
3669
|
-
|
3670
|
-
require.register("chai/utils/overwriteProperty.js", function(module, exports, require){
|
4061
|
+
});
|
4062
|
+
require.register("chai/lib/chai/utils/overwriteProperty.js", function(exports, require, module){
|
3671
4063
|
/*!
|
3672
4064
|
* Chai - overwriteProperty utility
|
3673
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
4065
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
3674
4066
|
* MIT Licensed
|
3675
4067
|
*/
|
3676
4068
|
|
@@ -3681,15 +4073,15 @@
|
|
3681
4073
|
* access to previous value. Must return function to use as getter.
|
3682
4074
|
*
|
3683
4075
|
* utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) {
|
3684
|
-
|
3685
|
-
|
3686
|
-
|
3687
|
-
|
3688
|
-
|
3689
|
-
|
3690
|
-
|
3691
|
-
|
3692
|
-
|
4076
|
+
* return function () {
|
4077
|
+
* var obj = utils.flag(this, 'object');
|
4078
|
+
* if (obj instanceof Foo) {
|
4079
|
+
* new chai.Assertion(obj.name).to.equal('bar');
|
4080
|
+
* } else {
|
4081
|
+
* _super.call(this);
|
4082
|
+
* }
|
4083
|
+
* }
|
4084
|
+
* });
|
3693
4085
|
*
|
3694
4086
|
*
|
3695
4087
|
* Can also be accessed directly from `chai.Assertion`.
|
@@ -3723,12 +4115,11 @@
|
|
3723
4115
|
});
|
3724
4116
|
};
|
3725
4117
|
|
3726
|
-
});
|
3727
|
-
|
3728
|
-
require.register("chai/utils/test.js", function(module, exports, require){
|
4118
|
+
});
|
4119
|
+
require.register("chai/lib/chai/utils/test.js", function(exports, require, module){
|
3729
4120
|
/*!
|
3730
4121
|
* Chai - test utility
|
3731
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
4122
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
3732
4123
|
* MIT Licensed
|
3733
4124
|
*/
|
3734
4125
|
|
@@ -3753,12 +4144,11 @@
|
|
3753
4144
|
return negate ? !expr : expr;
|
3754
4145
|
};
|
3755
4146
|
|
3756
|
-
});
|
3757
|
-
|
3758
|
-
require.register("chai/utils/transferFlags.js", function(module, exports, require){
|
4147
|
+
});
|
4148
|
+
require.register("chai/lib/chai/utils/transferFlags.js", function(exports, require, module){
|
3759
4149
|
/*!
|
3760
4150
|
* Chai - transferFlags utility
|
3761
|
-
* Copyright(c) 2012 Jake Luer <jake@alogicalparadox.com>
|
4151
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
3762
4152
|
* MIT Licensed
|
3763
4153
|
*/
|
3764
4154
|
|
@@ -3801,9 +4191,61 @@
|
|
3801
4191
|
}
|
3802
4192
|
};
|
3803
4193
|
|
3804
|
-
});
|
4194
|
+
});
|
4195
|
+
require.register("chai/lib/chai/utils/type.js", function(exports, require, module){
|
4196
|
+
/*!
|
4197
|
+
* Chai - type utility
|
4198
|
+
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
|
4199
|
+
* MIT Licensed
|
4200
|
+
*/
|
4201
|
+
|
4202
|
+
/*!
|
4203
|
+
* Detectable javascript natives
|
4204
|
+
*/
|
3805
4205
|
|
3806
|
-
|
4206
|
+
var natives = {
|
4207
|
+
'[object Arguments]': 'arguments'
|
4208
|
+
, '[object Array]': 'array'
|
4209
|
+
, '[object Date]': 'date'
|
4210
|
+
, '[object Function]': 'function'
|
4211
|
+
, '[object Number]': 'number'
|
4212
|
+
, '[object RegExp]': 'regexp'
|
4213
|
+
, '[object String]': 'string'
|
4214
|
+
};
|
3807
4215
|
|
3808
|
-
|
3809
|
-
|
4216
|
+
/**
|
4217
|
+
* ### type(object)
|
4218
|
+
*
|
4219
|
+
* Better implementation of `typeof` detection that can
|
4220
|
+
* be used cross-browser. Handles the inconsistencies of
|
4221
|
+
* Array, `null`, and `undefined` detection.
|
4222
|
+
*
|
4223
|
+
* utils.type({}) // 'object'
|
4224
|
+
* utils.type(null) // `null'
|
4225
|
+
* utils.type(undefined) // `undefined`
|
4226
|
+
* utils.type([]) // `array`
|
4227
|
+
*
|
4228
|
+
* @param {Mixed} object to detect type of
|
4229
|
+
* @name type
|
4230
|
+
* @api private
|
4231
|
+
*/
|
4232
|
+
|
4233
|
+
module.exports = function (obj) {
|
4234
|
+
var str = Object.prototype.toString.call(obj);
|
4235
|
+
if (natives[str]) return natives[str];
|
4236
|
+
if (obj === null) return 'null';
|
4237
|
+
if (obj === undefined) return 'undefined';
|
4238
|
+
if (obj === Object(obj)) return 'object';
|
4239
|
+
return typeof obj;
|
4240
|
+
};
|
4241
|
+
|
4242
|
+
});
|
4243
|
+
require.alias("chai/index.js", "chai/index.js");
|
4244
|
+
|
4245
|
+
if (typeof exports == "object") {
|
4246
|
+
module.exports = require("chai");
|
4247
|
+
} else if (typeof define == "function" && define.amd) {
|
4248
|
+
define(function(){ return require("chai"); });
|
4249
|
+
} else {
|
4250
|
+
this["chai"] = require("chai");
|
4251
|
+
}})();
|