Handle string comparisons correctly with equals_
This commit is contained in:
@@ -92,6 +92,16 @@ jasmine.isArray_ = function(value) {
|
||||
return Object.prototype.toString.apply(value) === '[object Array]';
|
||||
};
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
* @private
|
||||
* @param value
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
jasmine.isString_ = function(value) {
|
||||
return Object.prototype.toString.apply(value) === '[object String]';
|
||||
};
|
||||
|
||||
/**
|
||||
* Pretty printer for expecations. Takes any object and turns it into a human-readable string.
|
||||
*
|
||||
@@ -822,6 +832,10 @@ jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
|
||||
return b.matches(a);
|
||||
}
|
||||
|
||||
if (jasmine.isString_(a) && jasmine.isString_(b)) {
|
||||
return (a == b);
|
||||
}
|
||||
|
||||
if (typeof a === "object" && typeof b === "object") {
|
||||
return this.compareObjects_(a, b, mismatchKeys, mismatchValues);
|
||||
}
|
||||
@@ -2275,5 +2289,5 @@ jasmine.version_= {
|
||||
"major": 0,
|
||||
"minor": 10,
|
||||
"build": 1,
|
||||
"revision": 1268680515
|
||||
"revision": 1268838574
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user