freepascal / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

hasSimilarMethod() and Hamcrest AdditionalMatchers #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have run in to a problem where Mockito is passing arguments of the wrong
type to argument matchers.  Searching the web turned up this:

http://blogs.eficode.fi/tero/2008/10/17/mockito-gotcha-combining-custom-argument
-matchers-with-other-matchers-or-stubs/

My case is quite similar; however, I'm using the Hamcrest
AdditionalMatchers.eq(double, double) matcher.  It seems Hamcrest matchers
require they only be invoked with arguments of the correct type (no
instanceof check).  I have created a simple patch which allows Mockito to
report a failed match rather than throwing a ClassCastException.  Please
find the patch attached and let me know if there is something I can do to
help further.

Original issue reported on code.google.com by szcze...@gmail.com on 20 Apr 2009 at 7:44

GoogleCodeExporter commented 9 years ago
fixed in trunk

Original comment by szcze...@gmail.com on 20 Apr 2009 at 8:26

GoogleCodeExporter commented 9 years ago

Original comment by szcze...@gmail.com on 9 Jun 2009 at 3:15

GoogleCodeExporter commented 9 years ago

Original comment by brice.du...@gmail.com on 2 Dec 2012 at 10:21