What is the difference between should and must in

2019-09-18 10:33发布

问题:

This question already has an answer here:

  • In ScalaTest is there any difference between `should`, `can`, `must` 1 answer

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.