I used ScalaTest in my Scala Play project. But I have a question here, when to use normal assert(xxx === yyy)
and when to use ScalaTest matchers like xxx should be yyy
.
Personally I prefer to use assert as it is simple and clean. Also can take advantage of ScalaTest's TypedCheckTrippleEquals
support, but matchers can't.
For matchers, so far I only found out one thing matchers can do but not assert, which is Array(1, 2) should equal (Array(1, 2))
succeeds.
Not quite sure which is recommended and are there any other stuff matchers can do more? Otherwise happy to use assert.