<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -50,10 +50,22 @@ class Object
     meta_eval do
       module_eval(&quot;alias #{method_alias} #{method}&quot;)
     end
-        
+    
+    check_arity = Proc.new do |args|
+      arity = method(method_alias.to_sym).arity
+      if ((arity &gt;= 0) ?
+          (args.length != arity) :
+          (args.length &lt; ~arity))
+        # Negative arity means some params are optional, so we check
+        # for the minimum required.  Sadly, we can't tell what the
+        # maximum is.
+        raise ArgumentError
+      end
+    end
+    
     behavior = if options[:return]
                   lambda do |*args| 
-                    raise ArgumentError if args.length != method(method_alias.to_sym).arity
+                    check_arity.call(args)
                     
                     Stump::Mocks.verify([self, method])
 
@@ -67,7 +79,7 @@ class Object
                   end
                 else
                   lambda do |*args| 
-                    raise ArgumentError if args.length != method(method_alias.to_sym).arity
+                    check_arity.call(args)
 
                     Stump::Mocks.verify([self, method])
                     
@@ -100,4 +112,4 @@ class Object
     
     meta_def method, &amp;behavior
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/stump/proxy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,4 +9,8 @@ class MyStump
   def trunk(name)
     return name.upcase
   end
-end
\ No newline at end of file
+  
+  def branch(factor, initial = 1)
+    return factor * initial
+  end
+end</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -52,6 +52,20 @@ class TestProxy &lt; Test::Unit::TestCase
     end
   end
 
+  def test_proxy_optional_args_are_not_required
+    proxied = MyStump.new
+    proxied.proxy!(:branch)
+    
+    assert_raise ArgumentError do
+      proxied.branch
+    end
+    
+    assert_nothing_raised do
+      assert_equal 3, proxied.branch(3)
+      assert_equal 6, proxied.branch(3, 2)
+    end
+  end
+  
   def test_proxy_fail
     stumply = MyStump.new
     stumply.proxy!(:tree, :return =&gt; &quot;hi&quot;)</diff>
      <filename>test/test_proxy.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>63c14db451bdcbd6a763ffb3fb4daabb38c3a1af</id>
    </parent>
  </parents>
  <author>
    <name>Erik Ostrom</name>
    <email>erik@echographia.com</email>
  </author>
  <url>http://github.com/jeremymcanally/stump/commit/1ed0ae4fc58fd59aa2bacf620c461634d126fb10</url>
  <id>1ed0ae4fc58fd59aa2bacf620c461634d126fb10</id>
  <committed-date>2008-12-22T18:19:30-08:00</committed-date>
  <authored-date>2008-11-20T13:54:28-08:00</authored-date>
  <message>Stop Proxy's arity check from requiring args that are optional.

Signed-off-by: Jeremy McAnally &lt;jeremymcanally@gmail.com&gt;</message>
  <tree>e430defe491b7a054c29890ccf0681a831d9638f</tree>
  <committer>
    <name>Jeremy McAnally</name>
    <email>jeremymcanally@gmail.com</email>
  </committer>
</commit>
