Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Got all the boolean logic errors out of isEqual.

git-svn-id: file:///Users/jyurek/Backups/repositories/jocha/trunk@24 5317845c-832e-0410-b2c0-db6c5bc7c761
  • Loading branch information...
commit d73d63e6566ad93acac2aba907cf773c46b6f6cd 1 parent a5e6bb3
jyurek authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 jocha.js
View
12 jocha.js
@@ -7,12 +7,12 @@ Jocha = {
return !e.invoked;
}).compact();
- var unmet_string = "Not all expectations were met:\n";
+ var unmet_lines = ["Not all expectations were met:"];
unmet.each(function(e,i){
- unmet_string += (i+1) + ": " + e.functionName + "(" + e.params.map(Object.inspect) + ")\n";
+ unmet_lines.push( (i+1) + ": " + e.functionName + "(" + e.params.map(Object.inspect) + ")" );
});
- assert(unmet.size() == 0, unmet_string);
+ assert(unmet.size() == 0, unmet_lines.join("\n"));
});
},
reset: function()
@@ -129,15 +129,15 @@ Function.prototype.inspect = function() {
Array.prototype.isEqual = function(other) {
if (this.length != other.length) return false;
for (var p = 0; p < other.length; p++) {
- if(Object.equal( this[p], other[p] )) return false;
+ if(!Object.equal( this[p], other[p] )) return false;
}
return true;
}
Object.prototype.isEqual = function(other) {
if(this.attributes().length != other.attributes().length) return false;
- for(var p in this){
- if(Object.equal( this[p], other[p] )) return false;
+ for(var p in this) {
+ if(!Object.equal( this[p], other[p] )) return false;
}
return true;
}
Please sign in to comment.
Something went wrong with that request. Please try again.