describe("ObjectContaining", function() { it("matches any actual to an empty object", function() { var containing = new jasmineUnderTest.ObjectContaining({}); var matchersUtil = new jasmineUnderTest.MatchersUtil(); expect(containing.asymmetricMatch("foo", matchersUtil)).toBe(true); }); it("does not match an empty object actual", function() { var containing = new jasmineUnderTest.ObjectContaining("foo"); expect(function() { containing.asymmetricMatch({}) }).toThrowError(/not 'foo'/) }); it("matches when the key/value pair is present in the actual", function() { var containing = new jasmineUnderTest.ObjectContaining({foo: "fooVal"}); var matchersUtil = new jasmineUnderTest.MatchersUtil(); expect(containing.asymmetricMatch({foo: "fooVal", bar: "barVal"}, matchersUtil)).toBe(true); }); it("does not match when the key/value pair is not present in the actual", function() { var containing = new jasmineUnderTest.ObjectContaining({foo: "fooVal"}); var matchersUtil = new jasmineUnderTest.MatchersUtil(); expect(containing.asymmetricMatch({bar: "barVal", quux: "quuxVal"}, matchersUtil)).toBe(false); }); it("does not match when the key is present but the value is different in the actual", function() { var containing = new jasmineUnderTest.ObjectContaining({foo: "other"}); var matchersUtil = new jasmineUnderTest.MatchersUtil(); expect(containing.asymmetricMatch({foo: "fooVal", bar: "barVal"}, matchersUtil)).toBe(false); }); it("jasmineToString's itself", function() { var containing = new jasmineUnderTest.ObjectContaining({}); expect(containing.jasmineToString()).toMatch("