【问题标题】:What is the difference between should and must in scala testing? [duplicate]scala测试中应该和必须有什么区别? [复制]
【发布时间】:2016-09-22 23:21:23
【问题描述】:

scalatest 和 Specs2 对 shouldmust 都有单独的匹配器。

但是,我找不到任何解释您为什么要使用其中一个。

到底有什么区别?

【问题讨论】:

  • 我不知道为什么我无法通过 Google 或 SO 搜索找到该副本。

标签: scala testing scalatest specs2


【解决方案1】:

没有区别,这纯粹是句法偏好。我个人更喜欢在 specs2 中使用must,因为我认为should 可以让人认为期望是可选的。

【讨论】:

    猜你喜欢
    • 2011-07-18
    • 1970-01-01
    • 1970-01-01
    • 2017-11-11
    • 1970-01-01
    • 2011-12-06
    • 2011-12-02
    • 2015-11-23
    • 2013-02-13
    相关资源
    最近更新 更多