Permalink
Browse files

moved file around a bit

git-svn-id: file:///Users/jyurek/Backups/repositories/jocha/trunk@13 5317845c-832e-0410-b2c0-db6c5bc7c761
  • Loading branch information...
1 parent 4899965 commit baa7a08fbac550dd907a91f3a37aa792de31c7da tfwright committed Apr 20, 2007
Showing with 36 additions and 33 deletions.
  1. +36 −33 jocha.js
View
@@ -1,36 +1,6 @@
-// Thanks http://www.svendtofte.com/code/usefull_prototypes/
-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;
- }
- 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;
- }
- return true;
-}
-
-Object.equal = function(one, two){
- if(typeof(one) == "object" && one != null && one.isEqual){
- if(!one.isEqual(two)) return false;
- } else {
- if(one != two) return false;
- }
-}
-
-Object.prototype.attributes = function(){
- var attributes = [];
- for(var p in this){ attributes.push(p); }
- return attributes;
-}
-
Jocha = {
- mocks: []
+ mocks : [],
+ verify : function(){ this.mocks.each(function(m){})}
}
Jocha.Mock = Class.create();
Jocha.Mock.prototype = {
@@ -83,4 +53,37 @@ Object.extend(Object.prototype, {
return expectation.returnVal;
}
}
-});
+});
+
+// HELPERS
+
+// Thanks http://www.svendtofte.com/code/usefull_prototypes/
+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;
+ }
+ 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;
+ }
+ return true;
+}
+
+Object.equal = function(one, two){
+ if(typeof(one) == "object" && one != null && one.isEqual){
+ if(!one.isEqual(two)) return false;
+ } else {
+ if(one != two) return false;
+ }
+}
+
+Object.prototype.attributes = function(){
+ var attributes = [];
+ for(var p in this){ attributes.push(p); }
+ return attributes;
+}

0 comments on commit baa7a08

Please sign in to comment.