You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found for myself that the matcher name "contains" is a bit misleading. Because it sounds similarly to contains() method of java.util.Collection it may expected to behave like this: assertThat(List.of(1,2), contains(1))
But the expression above will throw an AssertionError, because contains() is acting like containsExactly().
So how do you think about renaming it?
Unfortunately the obvious problem here - is of course broken back compatibility ( If someone is using this matcher in his tests - they may have been broken and must be refactored
The text was updated successfully, but these errors were encountered:
I found for myself that the matcher name "contains" is a bit misleading. Because it sounds similarly to
contains()
method ofjava.util.Collection
it may expected to behave like this:assertThat(List.of(1,2), contains(1))
But the expression above will throw an
AssertionError
, becausecontains()
is acting likecontainsExactly()
.So how do you think about renaming it?
Unfortunately the obvious problem here - is of course broken back compatibility ( If someone is using this matcher in his tests - they may have been broken and must be refactored
The text was updated successfully, but these errors were encountered: