In my scala explorations I also came across the problem of testing and verifying mocks. In scala it is trivial to pass around predicates, however these are function objects, that can be applied, but don’t know much about their implementation. So while the code is readable the feedback can be quite bad.
Groovy’s assert
statement is a shining example, how both goals can be attainded. Just consider the following assertion:
assert ["100","Test", 11].contains("10"+"1")
It is beautiful to read (as opposed let’s say hamcrast that makes me use it’s own syntax to construct an expression tree). When it comes to execute this I also do get really good feedback:
Leave a Reply