<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -29,6 +29,7 @@ module Mocha
   
       def matches?(available_parameters)
         parameter = available_parameters.shift
+        return false unless parameter.respond_to?(:=~)
         parameter =~ @regexp
       end
   </diff>
      <filename>lib/mocha/parameter_matchers/regexp_matches.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,4 +22,23 @@ class RegexpMatchesTest &lt; Test::Unit::TestCase
     assert_equal &quot;regexp_matches(/oo/)&quot;, matcher.mocha_inspect
   end
   
+  def test_should_not_raise_error_on_empty_arguments
+    matcher = regexp_matches(/oo/)
+    assert_nothing_raised { matcher.matches?([]) }
+  end
+  
+  def test_should_not_match_on_empty_arguments
+    matcher = regexp_matches(/oo/)
+    assert !matcher.matches?([])
+  end
+  
+  def test_should_not_raise_error_on_argument_that_does_not_respond_to_equals_squiggle
+    matcher = regexp_matches(/oo/)
+    assert_nothing_raised { matcher.matches?([:foo]) }
+  end
+  
+  def test_should_not_match_on_argument_that_does_not_respond_to_equals_squiggle
+    matcher = regexp_matches(/oo/)
+    assert !matcher.matches?([:foo])
+  end
 end
\ No newline at end of file</diff>
      <filename>test/unit/parameter_matchers/regexp_matches_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e5f7311d8ba2150a200c5cdf5db4d6d9cde21778</id>
    </parent>
  </parents>
  <author>
    <name>Sander Hartlage</name>
    <email>sander@outside.in</email>
  </author>
  <url>http://github.com/floehopper/mocha/commit/3799298af3f002513ea1a0a812eb450c2257aca3</url>
  <id>3799298af3f002513ea1a0a812eb450c2257aca3</id>
  <committed-date>2009-09-15T07:51:41-07:00</committed-date>
  <authored-date>2009-07-08T09:03:01-07:00</authored-date>
  <message>The regexp_matches matcher won't match or raise an error on empty arguments or arguments that don't respond to #=~

Signed-off-by: James Mead &lt;james@floehopper.org&gt;</message>
  <tree>f918e0f8987649e30d98ea13faef323452fc318f</tree>
  <committer>
    <name>James Mead</name>
    <email>james@floehopper.org</email>
  </committer>
</commit>
