joepadde / mockito

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

Use other than toString in messages #317

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In the verify message that shows expected arguments and actual arguments, 
toString() is used to show both the expected and actual arguments.  Some 
classes don't have a very good toString() method, which makes the message less 
useful than it could be.  

Need to investigate ways of supplying an alternative form of extracting a 
string from an object, when calling verify.  For example, maybe a variant of 
verify that allows passing a method for formatting arguments.  

Whereas there are cases in which an ArgumentCaptor could be made to do some of 
this, I think there are cases where an ArgumentCaptor wouldn't work quite so 
well.  I need to think about this some more.

The original request can be found at 
http://groups.google.com/group/mockito/browse_frm/thread/fa9d894ef3040243

Original issue reported on code.google.com by dmwallace.nz on 13 Feb 2012 at 10:05

GoogleCodeExporter commented 8 years ago

Original comment by dmwallace.nz on 13 Feb 2012 at 10:06