Rename hashContaining to objectContaining, since this is javascript. Also call the toString from prettyPrinter

This commit is contained in:
gvanhove
2011-03-10 07:59:19 -08:00
parent 992367dcbc
commit 7158fc2426
7 changed files with 32 additions and 23 deletions

View File

@@ -207,8 +207,8 @@ jasmine.any = function(clazz) {
* @param sample {Object} sample
* @returns matchable object for the sample
*/
jasmine.hashContaining = function (sample) {
return new jasmine.Matchers.HashContaining(sample);
jasmine.objectContaining = function (sample) {
return new jasmine.Matchers.ObjectContaining(sample);
};
/**
@@ -937,11 +937,11 @@ jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
return b.matches(a);
}
if (a instanceof jasmine.Matchers.HashContaining) {
if (a instanceof jasmine.Matchers.ObjectContaining) {
return a.matches(b);
}
if (b instanceof jasmine.Matchers.HashContaining) {
if (b instanceof jasmine.Matchers.ObjectContaining) {
return b.matches(a);
}
@@ -1500,11 +1500,11 @@ jasmine.Matchers.Any.prototype.toString = function() {
return '<jasmine.any(' + this.expectedClass + ')>';
};
jasmine.Matchers.HashContaining = function (sample) {
jasmine.Matchers.ObjectContaining = function (sample) {
this.sample = sample;
};
jasmine.Matchers.HashContaining.prototype.matches = function(other, mismatchKeys, mismatchValues) {
jasmine.Matchers.ObjectContaining.prototype.matches = function(other, mismatchKeys, mismatchValues) {
mismatchKeys = mismatchKeys || [];
mismatchValues = mismatchValues || [];
@@ -1526,7 +1526,7 @@ jasmine.Matchers.HashContaining.prototype.matches = function(other, mismatchKeys
return (mismatchKeys.length === 0 && mismatchValues.length === 0);
};
jasmine.Matchers.HashContaining.prototype.toString = function () {
jasmine.Matchers.ObjectContaining.prototype.toString = function () {
return "<jasmine.hashContaining(" + jasmine.pp(this.sample) + ")>";
};
/**