The recommended way to install
First you need to install sbt itself then you need to add the specs2 dependency:
libraryDependencies += "org.specs2" %% "specs2-core" % "5.2.0" % "test"
// if you want to use ScalaJS you need to use %%%
libraryDependencies += "org.specs2" %%% "specs2-core" % "5.2.0" % "test"
// ScalaJS also requires the following setting which supports
// the regular expressions used in many specs2 matchers using strings
scalaJSLinkerConfig ~= { _.withESFeatures(_.withESVersion(ESVersion.ES2018)) }
See here to learn more about sbt dependencies.
Depending on the
Name | Functionality |
---|---|
specs2-matcher-extra |
for the optional |
specs2-html |
to export specifications as html |
specs2-form |
to create html form-like specifications (experimental) |
specs2-junit |
to run specifications as JUnit tests |
scalamock |
to use mocks in specifications (see the ScalaMock project) |
specs2-scalacheck |
to use ScalaCheck properties in specifications (see the ScalaCheck project) |
specs2-cats |
for the cats matchers (see specs2-cats) |
specs2-scalaz |
for the scalaz matchers (see specs2-scalaz) |
Note: the specs2-core
jar depends on 3 other
Name | Functionality |
---|---|
specs2-fp |
utility classes for functional programming |
specs2-common |
utility classes for text, collections, xml,… |
specs2-matcher |
common |