use jasmineMatches for equality testing of complicated matchers

This commit is contained in:
gvanhove
2011-03-15 08:23:38 -07:00
parent 4f2fcff15a
commit 67ec0af254
4 changed files with 154 additions and 6 deletions

View File

@@ -230,12 +230,12 @@ jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
return a.getTime() == b.getTime();
}
if (a instanceof jasmine.Matchers.Any) {
return a.matches(b);
if (a.jasmineMatches) {
return a.jasmineMatches(b);
}
if (b instanceof jasmine.Matchers.Any) {
return b.matches(a);
if (b.jasmineMatches) {
return b.jasmineMatches(a);
}
if (a instanceof jasmine.Matchers.ObjectContaining) {