<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -36,13 +36,13 @@ Smoke.Mock = function(originalObj) {
 		var mock = this;
 		if(this._expectations[attr].length&gt;1) return expectation;
 		this[attr] = function() {
+		  var ret = undefined;
 		  for(var i=0; i&lt;mock._expectations[attr].length; i++) {
 		    var expectation = mock._expectations[attr][i];
 			  var ran = expectation.run(arguments);
-			  var functionResult = previousFunction!=undefined ? previousFunction.apply(mock,arguments) : undefined;
-			  if(ran &amp;&amp; expectation.hasReturnValue) return expectation.returnValue;
+			  if(ran &amp;&amp; expectation.hasReturnValue) ret = expectation.returnValue;
 		  };
-			return functionResult
+			return ret;
 		};
 		return expectation;
 	};</diff>
      <filename>lib/smoke.mock.js</filename>
    </modified>
    <modified>
      <diff>@@ -58,12 +58,6 @@ Screw.Unit(function() {
 				m.bar();
 			});
 		  
-		  it(&quot;should allow stubbing on mocks&quot;, function() {
-				var m = mock({foo: function() { throw('I should not have been called!')}});
-				m.should_receive('foo').stub.and_return('hello');
-				m.foo();
-			});
-		  
 			it(&quot;should allow return values directly from mocks&quot;,function() {
 				var m = mock()
 				m.should_receive('bar').exactly('once').and_return('hello');
@@ -128,10 +122,10 @@ Screw.Unit(function() {
 				expect(mockObj.length).to(equal,4);
 			});
 			
-			it(&quot;should place expectations on existing methods non-destructively&quot;, function() {
-				myMock = mock({ say: &quot;hello&quot;, shout: function() { return this.say.toUpperCase(); } });
+			it(&quot;should place expectations on existing methods destructively&quot;, function() {
+				myMock = mock({ say: &quot;hello&quot;, shout: function() { throw &quot;FAIL!&quot; } });
 				myMock.should_receive('shout').exactly('once');
-				expect(myMock.shout()).to(equal,'HELLO');
+				myMock.shout()
 			});
 		});
 		
@@ -171,15 +165,6 @@ Screw.Unit(function() {
         mockObj('a');
       });
       
-      it(&quot;should call the original even if a return value is specified&quot;, function() {
-        var a = false
-        var func = function() { a = true };
-        var mockFunc = mock_function(func);
-        mockFunc.should_be_invoked().and_return('hello');
-        expect(mockFunc()).to(equal, 'hello');        
-        expect(a).to(equal, true);        
-      });
-      
       it(&quot;allows passing in a name for the function as a second argument to make error messages clearer&quot;, function() {
         mock_function(foo, 'foo').should_be_invoked().exactly('once');
         try {</diff>
      <filename>spec/mock_spec.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1b5053e96970fda06cd1b42c1bcd09a27628c6cb</id>
    </parent>
  </parents>
  <author>
    <name>Andy Kent</name>
    <email>andrew.d.kent@gmail.com</email>
  </author>
  <url>http://github.com/andykent/smoke/commit/99292588441142a1e370cc5e46ebe09c767c4ec4</url>
  <id>99292588441142a1e370cc5e46ebe09c767c4ec4</id>
  <committed-date>2009-05-20T13:01:39-07:00</committed-date>
  <authored-date>2009-05-20T13:01:39-07:00</authored-date>
  <message>mocks are now destructive as this is the behaviour most other libs use</message>
  <tree>9cb1bbfbc3e4799b8c99e15f715506e815967009</tree>
  <committer>
    <name>Andy Kent</name>
    <email>andrew.d.kent@gmail.com</email>
  </committer>
</commit>
