Closed GoogleCodeExporter closed 8 years ago
Hey,
1. There is an alias: anyObject() == any(Clazz)
2. You can play around with static import, e.g. get rid of '*' wildcard, etc.
Might help
Original comment by szcze...@gmail.com
on 9 Mar 2010 at 9:42
Ah, sorry about that. I looked through all the any methods... I must have
missed that
one.
startsWith(String) and endsWith(String) also are in conflict. I haven't gone
through
the whole list, so there may be more. It is also something to think about when
you
add new methods to the Matchers class.
"get rid of '*' wildcard, etc"
Yeah, but it can be a real pain to have to import all of the methods
individually
when you are using a lot of them.
Original comment by brianmat...@gmail.com
on 9 Mar 2010 at 10:02
So the complier complains only when you use those methods?
Forget about hamcrest. Use FEST-assert :)
Original comment by szcze...@gmail.com
on 9 Mar 2010 at 10:05
Yeah, I get a message similar to the following:
The method startsWith(String) is ambiguous for the type TestClass
"Forget about hamcrest. Use FEST-assert"
That looks awesome. I'm very sad I hadn't heard of it sooner. I will be looking
into
it. Thanks!
However, I think I am stuck with hamcrest when using mockito.
Original comment by brianmat...@gmail.com
on 9 Mar 2010 at 10:18
I think the other Mockito matchers but any() are hardly used by anyone so let's
not
worry about them.
Let me know if you hit the problem with some other matcher that clashes - we
will
decide what to do.
In meantime I will update the javadocs to make sure it is clear that any() ==
anyObject()
Thanks!
Original comment by szcze...@gmail.com
on 9 Mar 2010 at 11:21
Sounds good to me.
Original comment by brianmat...@gmail.com
on 10 Mar 2010 at 1:16
Original comment by szcze...@gmail.com
on 15 Mar 2010 at 8:19
Original comment by szcze...@gmail.com
on 17 Mar 2010 at 8:28
Original comment by szcze...@gmail.com
on 17 Mar 2010 at 8:32
Original comment by brice.du...@gmail.com
on 2 Dec 2012 at 10:21
Original issue reported on code.google.com by
brianmat...@gmail.com
on 9 Mar 2010 at 9:37