// Overide these functions for custom pass/fail behaviours Smoke.passed = function(mock){ Smoke.passCount++; }; Smoke.failed = function(mock, message){ Smoke.failCount++; throw(message); }; // Some helpers Smoke.reset = function(){ Smoke.mocks = []; Smoke.passCount = 0; Smoke.failCount = 0; }; Smoke.reset(); Smoke.checkExpectations = function(){ for(var i=0; i=this.callCount) Smoke.passed(this);//console.log('Mock passed!') else Smoke.failed(this, 'expected '+this.methodSignature()+' to be called at most '+this.maxCount+" times but it actually got called "+this.callCount+' times'); }, methodSignature: function(){ var a = ''; var args = this.callerArgs; for(var i=0; i