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
importorg.specs2.matcher.ValueCheckimportorg.specs2.mutable.SpecificationclassSpecextendsSpecification {
"strings" should {
"all be unique" in {
valstrings=List("foo", "foo", "bar", "qux")
strings.map { string =>
strings must contain(string: ValueCheck[String]).exactly(1.times)
}
}
}
}
fails with the message
List(foo, foo, bar, qux) does not contain foo
which is obviously false. It's not a huge deal with such small lists, but when lists have hundreds of elements, and you just read the beginning and the end of the failure message, it can be a lot more confusing:
List(foo, bar, qux, ...) does not contain foo
The methods that change the behavior of ContainWithResult should also change the failure message.
The text was updated successfully, but these errors were encountered:
fails with the message
which is obviously false. It's not a huge deal with such small lists, but when lists have hundreds of elements, and you just read the beginning and the end of the failure message, it can be a lot more confusing:
The methods that change the behavior of
ContainWithResult
should also change the failure message.The text was updated successfully, but these errors were encountered: