首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >sbt项目找不到ScalaCheck

sbt项目找不到ScalaCheck
EN

Stack Overflow用户
提问于 2016-12-04 17:53:21
回答 1查看 148关注 0票数 0

使用sbt测试代码

代码语言:javascript
复制
package examples
import org.specs2._

class ScalaCheckExamplesSpec extends Specification with ScalaCheck { def is = s2"""
  startsWith ${ prop { (a: String, b: String) => (a+b) must startWith(a) } }
  endsWith   ${ prop { (a: String, b: String) => (a+b) must endWith(b) } }
  substring  ${ prop { (a: String, b: String) => (a+b).substring(a.length) === b } }
  substring  ${ prop { (a: String, b: String, c: String) => (a+b+c).substring(a.length, a.length+b.length) === b } }                                                                                                                       """
}

使用sbt配置:

代码语言:javascript
复制
libraryDependencies ++= Seq(
    "org.specs2" %% "specs2-core" % "3.8.5" % "test",
    "org.scalacheck" %% "scalacheck" % "1.13.4" % "test"
)

找不到类ScalaCheck

代码语言:javascript
复制
ScalaCheckExamplesSpec.scala:11: not found: type ScalaCheck
[error] class ScalaCheckExamplesSpec extends Specification with ScalaCheck {

如何解决错误?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-12-04 18:17:18

你需要:

代码语言:javascript
复制
libraryDependencies ++= Seq(
  "org.specs2" %% "specs2-core" % "3.8.5" % "test",
  // the scalacheck lib will come as a transitive
  // dependency
  "org.specs2" %% "specs2-scalacheck" % "3.8.5" % "test"
)
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40961713

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档