<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -109,7 +109,7 @@ Screw.Stub = (function() {
             }
 
             if (private.oldVal.constructor === Function) {
-                return private.oldVal();
+                return private.oldVal.apply(obj, arguments);
             } else {
                 return private.oldVal;
             }</diff>
      <filename>lib/screw.stub.js</filename>
    </modified>
    <modified>
      <diff>@@ -102,6 +102,17 @@ Screw.Unit(function() {
                 Screw.Stub.reset();
                 expect(obj.pizza()).to(equal, expected);
             });
+
+            it(&quot;should call original method with arguments if stub is not matched&quot;, function() {
+              var originalMethodCalled = false;
+              obj = { methodToStub: function(a) {
+                        originalMethodCalled = true;
+                        expect(a).to(equal, 'foo'); } };
+              Screw.Stub.shouldReceive(obj, 'methodToStub').withArguments('bar');
+              obj.methodToStub('foo');
+              obj.methodToStub('bar');
+              expect(originalMethodCalled).to(be_true);
+            });
         });
     });
 });</diff>
      <filename>spec/stub_spec.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>65473aec8e67658889a3a9548b376078d924a989</id>
    </parent>
  </parents>
  <author>
    <name>Mat Schaffer</name>
    <email>mat.schaffer@gmail.com</email>
  </author>
  <url>http://github.com/tobowers/screw-unit/commit/ad2ff70b8b3f24e62d05404c912bf5ad2d00fbd9</url>
  <id>ad2ff70b8b3f24e62d05404c912bf5ad2d00fbd9</id>
  <committed-date>2009-06-30T15:49:29-07:00</committed-date>
  <authored-date>2009-06-30T15:49:29-07:00</authored-date>
  <message>shouldReceive is set up to call the original function if the withArguments doesn't match. But it calls it without arguments. This patch fixes it so it includes arguments in the call.</message>
  <tree>91fc44129bc237e4259cec90bb84a4df9fed30ee</tree>
  <committer>
    <name>Mat Schaffer</name>
    <email>mat.schaffer@gmail.com</email>
  </committer>
</commit>
