Manage spys/matchers/custom equalities for beforeAll

- Refactor expectations to take list of matchers
- Add spyRegistry to manage runnables' spies
- Add clone util

[#66789174]
This commit is contained in:
Christopher Amavisca, Greg Cobb and Sheel Choksi
2014-03-05 10:28:37 -08:00
parent 52026fb0f7
commit 752a36d3ff
12 changed files with 441 additions and 272 deletions

View File

@@ -30,5 +30,20 @@ getJasmineRequireObj().util = function() {
return obj === void 0;
};
util.clone = function(obj) {
if (Object.prototype.toString.apply(obj) === "[object Array]") {
return obj.slice();
}
var cloned = {};
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
cloned[prop] = obj[prop];
}
}
return cloned;
}
return util;
};