Resolve remaining test issues

This commit is contained in:
Greg Cobb and JR Boyens
2013-07-22 11:57:47 -07:00
parent 61a1f93488
commit 8c1881053c
5 changed files with 32 additions and 4 deletions

View File

@@ -5,6 +5,8 @@ getJasmineRequireObj().ObjectContaining = function(j$) {
}
ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) {
if (typeof(this.sample) !== "object") { throw new Error("You must provide an object to objectContaining, not '"+this.sample+"'."); }
mismatchKeys = mismatchKeys || [];
mismatchValues = mismatchValues || [];
@@ -16,7 +18,7 @@ getJasmineRequireObj().ObjectContaining = function(j$) {
if (!hasKey(other, property) && hasKey(this.sample, property)) {
mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
}
else if (!j$.matchersUtil.equals(this.sample[property], other[property], mismatchKeys, mismatchValues)) {
else if (!j$.matchersUtil.equals(this.sample[property], other[property])) {
mismatchValues.push("'" + property + "' was '" + (other[property] ? j$.util.htmlEscape(other[property].toString()) : other[property]) + "' in actual, but was '" + (this.sample[property] ? j$.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in expected.");
}
}