问题
Both scalatest and Specs2 have separate matchers for should
and must
.
However, I cannot find any explanation for why you would use one or the other.
What exactly is the difference?
回答1:
There is no difference, this is purely a syntactic preference. I personally prefer to use must
in specs2 because I think that should
can make people think that an expectation is optional.
来源:https://stackoverflow.com/questions/37435701/what-is-the-difference-between-should-and-must-in-scala-testing