<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,7 +8,7 @@ class CustomMatcher
     Object.const_set(build_class_name(class_name), klass)
   end
   
-  def initialize(expected = nil)
+  def initialize(*expected)
     @expected = expected
   end
   
@@ -26,10 +26,11 @@ class CustomMatcher
   
   def matches?(target)
     @target = target
-    if self.method(:matcher).arity == 2
-      matcher(@target, @expected)
-    else
-      matcher(@target)
+    case self.method(:matcher).arity
+    when -1, 2..10 then matcher(@target, *@expected)
+    when  1        then matcher(@target)
+    when  0        then matcher()
+    else fail
     end
   end
 
@@ -40,7 +41,8 @@ class CustomMatcher
 private
 
   def message(positive = true)
-    &quot;#{positive ? 'Expected' : 'Did not expect'} #{@target.inspect} to #{class_display_name} #{@expected.inspect if self.method(:matcher).arity == 2}&quot;
+    expected = @expected.size == 1 ? @expected.first : @expected
+    &quot;#{positive ? 'Expected' : 'Did not expect'} #{@target.inspect} to #{class_display_name} #{expected.inspect if self.method(:matcher).arity == 2}&quot;
   end
   
   def class_display_name</diff>
      <filename>lib/rspec-custom-matchers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,8 +6,24 @@ matcher(:be_divisible_by) { |number, divisor| number % divisor == 0 }
 matcher(:be_even) {|even| even % 2 == 0}
 matcher(:be_odd) {|odd| odd % 2 != 0}
 matcher(:be_equal_to)
+matcher(:be_close_to) do |*args|
+  l,r, margin = args
+  (l - r).abs &lt;= (margin || 1)
+end
+matcher(:be_sum_of) do |l,r,add|
+  l.should == r + add
+end
 
 describe &quot;6&quot; do
+  it &quot;should be close to&quot; do
+    6.should be_close_to(5)
+    6.should be_close_to(4,2)
+  end
+
+  it &quot;should be sum of&quot; do
+    6.should be_sum_of(4,2)
+  end
+
   it &quot;should be divisible by 3&quot; do
     6.should be_divisible_by(3)
   end</diff>
      <filename>spec/matcher_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>02f2a7af7247496eb1f425796f5c194d41e8786a</id>
    </parent>
  </parents>
  <author>
    <name>Greg Weber</name>
    <email>greg@grubtop.(none)</email>
  </author>
  <url>http://github.com/xdotcommer/rspec-custom-matchers/commit/10aca0d6f6833531a11838747680dad6c21da787</url>
  <id>10aca0d6f6833531a11838747680dad6c21da787</id>
  <committed-date>2009-04-16T13:03:56-07:00</committed-date>
  <authored-date>2009-04-16T08:15:22-07:00</authored-date>
  <message>support for more than 2 arguments to matcher

Signed-off-by: Michael Cowden &lt;mcowden@yahoo.com&gt;</message>
  <tree>e4888eea2c23e557029cb9b53d358a02686eb114</tree>
  <committer>
    <name>Michael Cowden</name>
    <email>mcowden@yahoo.com</email>
  </committer>
</commit>
