assets/vendor/smoke/lib/smoke.mock.js in screw_server-0.1.7 vs assets/vendor/smoke/lib/smoke.mock.js in screw_server-0.1.8

- old
+ new

@@ -32,20 +32,20 @@ if (!this._valuesBeforeMocking.hasOwnProperty(attr)) { this._valuesBeforeMocking[attr] = this[attr]; } return new Smoke.Stub(this, attr); }; - + obj.should_receive = function(attr){ var expectation = new Smoke.Mock.Expectation(this, attr); this._expectations[attr] = (this._expectations[attr] || []).concat([expectation]); if (!this._valuesBeforeMocking.hasOwnProperty(attr)) { this._valuesBeforeMocking[attr] = this[attr]; } if(this._expectations[attr].length == 1) { this[attr] = Smoke.Mock.Expectation.stub(this, attr); - } + } return expectation; }; obj.should_not_receive = function(attr){ return obj.should_receive(attr).exactly(0, "times"); @@ -61,24 +61,24 @@ for(var e in this._expectations) { var expectations = this._expectations[e] for(var i=0; i < expectations.length; i++) expectations[i].check(); }; }; - + obj._resetMocks = function(){ for(var attr in this._valuesBeforeMocking) { this[attr] = this._valuesBeforeMocking[attr]; } - + delete this._valuesBeforeMocking; delete this._expectations; delete this._resetMocks; delete this._checkExpectations; delete this.stub; delete this.should_receive; }; - + Smoke.mocks.push(obj); return obj; }; Smoke.MockFunction = function(originalFunction, name) { @@ -206,10 +206,10 @@ methodSignature: function(){ return this._attr + Smoke.printArguments(this.callerArgs); }, parseCount: function(c){ switch(c){ - case 'once': + case 'once': return 1; case 'twice': return 2; default: return c;