What is the difference between should and must in scala testing? [duplicate]

五迷三道 提交于 2019-12-25 06:28:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!