expect and anyArgs

18 views
Skip to first unread message

John Nyquist

unread,
Nov 16, 2014, 5:30:27 PM11/16/14
to mock...@googlegroups.com
I'm switching some code written like this:
     mock(foo).method("bar").anyArgs();

To code like this:
     expect(foo.bar(arg(instanceOf(String))));

But doing an instanceOf(String) really isn't the same is it? How would you indicate that any argument is okay for the latter approach?

John Nyquist

unread,
Nov 19, 2014, 2:03:21 PM11/19/14
to mock...@googlegroups.com
It occurred to me I could probably do this (have not tried yet):
     expect(foo.bar(arg(anything())));
Reply all
Reply to author
Forward
0 new messages