(expectation, actual)
| 1037 | } |
| 1038 | |
| 1039 | function matchObject(expectation, actual) { |
| 1040 | if (actual === null || actual === undefined) { |
| 1041 | return false; |
| 1042 | } |
| 1043 | for (var key in expectation) { |
| 1044 | if (expectation.hasOwnProperty(key)) { |
| 1045 | var exp = expectation[key]; |
| 1046 | var act = actual[key]; |
| 1047 | if (match.isMatcher(exp)) { |
| 1048 | if (!exp.test(act)) { |
| 1049 | return false; |
| 1050 | } |
| 1051 | } else if (sinon.typeOf(exp) === "object") { |
| 1052 | if (!matchObject(exp, act)) { |
| 1053 | return false; |
| 1054 | } |
| 1055 | } else if (!sinon.deepEqual(exp, act)) { |
| 1056 | return false; |
| 1057 | } |
| 1058 | } |
| 1059 | } |
| 1060 | return true; |
| 1061 | } |
| 1062 | |
| 1063 | matcher.or = function (m2) { |
| 1064 | if (!arguments.length) { |
no outgoing calls
no test coverage detected
searching dependent graphs…