konacha-chai-matchers 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSIONS +5 -5
- data/lib/konacha-chai-matchers/library.rb +4 -0
- data/lib/konacha-chai-matchers/version.rb +1 -1
- data/vendor/assets/javascripts/chai-as-promised.js +286 -324
- data/vendor/assets/javascripts/chai-changes.js +14 -6
- data/vendor/assets/javascripts/chai-jquery.js +23 -3
- data/vendor/assets/javascripts/mocha-as-promised.js +11 -4
- data/vendor/assets/javascripts/sinon.js +485 -283
- metadata +21 -29
@@ -1,5 +1,6 @@
|
|
1
|
-
// Generated by CoffeeScript 1.
|
1
|
+
// Generated by CoffeeScript 1.4.0
|
2
2
|
(function() {
|
3
|
+
|
3
4
|
(function(chaiChanges) {
|
4
5
|
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
|
5
6
|
return module.exports = chaiChanges;
|
@@ -37,7 +38,7 @@
|
|
37
38
|
done = function() {};
|
38
39
|
}
|
39
40
|
promiseCallback = function() {
|
40
|
-
var
|
41
|
+
var _j, _len1;
|
41
42
|
try {
|
42
43
|
for (_j = 0, _len1 = definedActions.length; _j < _len1; _j++) {
|
43
44
|
action = definedActions[_j];
|
@@ -46,8 +47,7 @@
|
|
46
47
|
}
|
47
48
|
}
|
48
49
|
return done();
|
49
|
-
} catch (
|
50
|
-
error = _error;
|
50
|
+
} catch (error) {
|
51
51
|
done(error);
|
52
52
|
throw error;
|
53
53
|
}
|
@@ -130,7 +130,11 @@
|
|
130
130
|
changed = !utils.eql(startValue, endValue);
|
131
131
|
context.assert(changed, "expected `" + (formatFunction(object)) + "` to change to " + (utils.inspect(this.expectedEndValue)) + ", but it did not change from " + (utils.inspect(startValue)), "not supported");
|
132
132
|
}
|
133
|
-
|
133
|
+
if (this.expectedEndValue instanceof RegExp) {
|
134
|
+
result = this.expectedEndValue.test(endValue);
|
135
|
+
} else {
|
136
|
+
result = utils.eql(endValue, this.expectedEndValue);
|
137
|
+
}
|
134
138
|
context.assert(result, "expected `" + (formatFunction(object)) + "` to change to " + (utils.inspect(this.expectedEndValue)) + ", but it changed to " + (utils.inspect(endValue)), "expected `" + (formatFunction(object)) + "` not to change to " + (utils.inspect(this.expectedEndValue)) + ", but it did");
|
135
139
|
return flag(context, 'negate', negate);
|
136
140
|
};
|
@@ -140,7 +144,11 @@
|
|
140
144
|
flag(context, 'negate', this.negate);
|
141
145
|
object = flag(context, 'whenObject');
|
142
146
|
startValue = object();
|
143
|
-
|
147
|
+
if (this.expectedStartValue instanceof RegExp) {
|
148
|
+
result = this.expectedStartValue.test(startValue);
|
149
|
+
} else {
|
150
|
+
result = utils.eql(startValue, this.expectedStartValue);
|
151
|
+
}
|
144
152
|
context.assert(result, "expected the change of `" + (formatFunction(object)) + "` to start from " + (utils.inspect(this.expectedStartValue)) + ", but it started from " + (utils.inspect(startValue)), "expected the change of `" + (formatFunction(object)) + "` not to start from " + (utils.inspect(this.expectedStartValue)) + ", but it did");
|
145
153
|
return flag(context, 'negate', negate);
|
146
154
|
};
|
@@ -21,6 +21,26 @@
|
|
21
21
|
flag = utils.flag;
|
22
22
|
$ = $ || jQuery;
|
23
23
|
|
24
|
+
var setPrototypeOf = '__proto__' in Object ?
|
25
|
+
function (object, prototype) {
|
26
|
+
object.__proto__ = prototype;
|
27
|
+
} :
|
28
|
+
function (object, prototype) {
|
29
|
+
var excludeNames = /^(?:length|name|arguments|caller)$/;
|
30
|
+
|
31
|
+
function copyProperties(dst, src) {
|
32
|
+
Object.getOwnPropertyNames(src).forEach(function (name) {
|
33
|
+
if (!excludeNames.test(name)) {
|
34
|
+
Object.defineProperty(dst, name,
|
35
|
+
Object.getOwnPropertyDescriptor(src, name));
|
36
|
+
}
|
37
|
+
});
|
38
|
+
}
|
39
|
+
|
40
|
+
copyProperties(object, prototype);
|
41
|
+
copyProperties(object, Object.getPrototypeOf(prototype));
|
42
|
+
};
|
43
|
+
|
24
44
|
$.fn.inspect = function (depth) {
|
25
45
|
var el = $('<div />').append(this.clone());
|
26
46
|
if (depth !== undefined) {
|
@@ -171,7 +191,7 @@
|
|
171
191
|
_super.apply(this, arguments);
|
172
192
|
}
|
173
193
|
};
|
174
|
-
be
|
194
|
+
setPrototypeOf(be, this);
|
175
195
|
return be;
|
176
196
|
}
|
177
197
|
});
|
@@ -208,7 +228,7 @@
|
|
208
228
|
Function.prototype.apply.call(_super.call(this), this, arguments);
|
209
229
|
}
|
210
230
|
};
|
211
|
-
contain
|
231
|
+
setPrototypeOf(contain, this);
|
212
232
|
return contain;
|
213
233
|
}
|
214
234
|
});
|
@@ -227,7 +247,7 @@
|
|
227
247
|
, selector
|
228
248
|
);
|
229
249
|
};
|
230
|
-
have
|
250
|
+
setPrototypeOf(have, this);
|
231
251
|
return have;
|
232
252
|
} else {
|
233
253
|
_super.call(this);
|
@@ -60,8 +60,13 @@
|
|
60
60
|
}((function () {
|
61
61
|
"use strict";
|
62
62
|
|
63
|
-
function
|
64
|
-
|
63
|
+
function getThen(x) {
|
64
|
+
if ((typeof x === "object" || typeof x === "function") && x !== null) {
|
65
|
+
var then = x.then;
|
66
|
+
if (typeof then === "function") {
|
67
|
+
return then;
|
68
|
+
}
|
69
|
+
}
|
65
70
|
}
|
66
71
|
|
67
72
|
var duckPunchedAlready = false;
|
@@ -111,9 +116,11 @@
|
|
111
116
|
// within a suite.
|
112
117
|
var retVal = fn.call(this, done);
|
113
118
|
|
114
|
-
|
119
|
+
var then = getThen(retVal);
|
120
|
+
if (then) {
|
115
121
|
// If we get a promise back...
|
116
|
-
|
122
|
+
then.call(
|
123
|
+
retVal,
|
117
124
|
function () {
|
118
125
|
// On fulfillment, ignore the fulfillment value and call `done()` with no arguments.
|
119
126
|
done();
|