New matcher "hashContaining" similar to rspec's hash_including

This commit is contained in:
gvanhove
2011-03-09 18:56:28 -08:00
parent ce886e20e4
commit 992367dcbc
5 changed files with 188 additions and 0 deletions

View File

@@ -238,6 +238,14 @@ jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
return b.matches(a);
}
if (a instanceof jasmine.Matchers.HashContaining) {
return a.matches(b);
}
if (b instanceof jasmine.Matchers.HashContaining) {
return b.matches(a);
}
if (jasmine.isString_(a) && jasmine.isString_(b)) {
return (a == b);
}