diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 51272cb2..2717139e 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -1382,7 +1382,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])) { + else if (!j$.matchersUtil.equals(other[property], this.sample[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.'); } } diff --git a/spec/core/ObjectContainingSpec.js b/spec/core/ObjectContainingSpec.js index 24341532..27bd71ef 100644 --- a/spec/core/ObjectContainingSpec.js +++ b/spec/core/ObjectContainingSpec.js @@ -61,4 +61,10 @@ describe("ObjectContaining", function() { expect(containing.jasmineToString()).toMatch("