<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,5 @@
 Screw.Matchers.argWhichWill = function(matcher, expected) {
-  return {argumentMatcher: true, matcher: matcher, expected: expected};
+  return new Screw.Stub.ArgumentMatcher(matcher, expected);
 };
 
 Screw.Stub = (function() {
@@ -29,7 +29,7 @@ Screw.Stub = (function() {
 
         self.accepts = function() { 
             return true;
-        }
+        };
 
         obj[name].stubs.push(self);
         return self;
@@ -67,9 +67,9 @@ Screw.Stub = (function() {
                 for (var i=0; i &lt; args.length; i++) {
                     var expected = private.expectedArguments[i];
                     var actual = args[i];
-                    if (expected.argumentMatcher) {
+                    if (expected instanceof Screw.Stub.ArgumentMatcher) {
                         if (!expected.matcher.match(expected.expected, actual))
-                          return false;
+                            return false;
                     } else if (actual !== expected) {
                         return false;
                     }
@@ -160,6 +160,11 @@ Screw.Stub = (function() {
         }
     };
 
+    self.ArgumentMatcher = function(matcher, expected) {
+      this.matcher = matcher;
+      this.expected = expected;
+    };
+
     return self;
 }());
 </diff>
      <filename>lib/screw.stub.js</filename>
    </modified>
    <modified>
      <diff>@@ -68,7 +68,15 @@ Screw.Unit(function() {
                 expect(obj.pizza(&quot;cheese&quot;)).to(equal, &quot;yummy&quot;);
                 expect(obj.pizza.validate).to_not(raise);
             });
-            
+
+            it(&quot;should correctly match null values in specified argument list&quot;, function() {
+                obj.pizza = function() { return &quot;gross&quot; };
+                Screw.Stub.shouldReceive(obj, &quot;pizza&quot;).withArguments(null, &quot;cheese&quot;).andReturn(&quot;null yummy&quot;);
+                expect(obj.pizza()).to(equal, &quot;gross&quot;);
+                expect(obj.pizza(null, &quot;cheese&quot;)).to(equal, &quot;null yummy&quot;);
+                expect(obj.pizza.validate).to_not(raise);
+            });
+
             it(&quot;should match arguments using matchers&quot;, function() {
                 Screw.Stub.shouldReceive(obj, &quot;pizza&quot;).withArguments(argWhichWill(match, /sausage/));
                 obj.pizza(&quot;turkey sausage&quot;);</diff>
      <filename>spec/stub_spec.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5a18badee9c78ce264025d1cf0c1084f2f1709fe</id>
    </parent>
  </parents>
  <author>
    <name>Mat Schaffer</name>
    <email>mat.schaffer@gmail.com</email>
  </author>
  <url>http://github.com/tobowers/screw-unit/commit/c912bee393e897ddc0bfd8fecf8ac6442915db7a</url>
  <id>c912bee393e897ddc0bfd8fecf8ac6442915db7a</id>
  <committed-date>2009-05-28T14:13:48-07:00</committed-date>
  <authored-date>2009-05-28T14:13:48-07:00</authored-date>
  <message>Corrected handling of withArguments to support argument lists that contained a null value.</message>
  <tree>998c11d49ebcdc441927e6949c6557150aabfefb</tree>
  <committer>
    <name>Mat Schaffer</name>
    <email>mat.schaffer@gmail.com</email>
  </committer>
</commit>
