noException should be thrownBy myFunc()
形式的测试
我无法弄清楚我需要导入哪个类才能将noException
放入范围。我目前正在Flatspec with ShouldMatchers
中混音,我也尝试过with Matchers
我错过了什么?
如果重要,我使用scalatest 1.9.1和scala 2.9:
scalaVersion := "2.9.3"
[...]
"org.scalatest" %% "scalatest" % "1.9.1" % "test",
答案 0 :(得分:1)
Scalatest 2.0添加thrownBy
,大概noException
附带了它。您需要将scalatest升级到2.x版本,这也意味着将scala升级到2.10 +