CheckOps
specs2
specs2 is an MIT-licensed Scala library for writing executable software specifications, offering unit and acceptance specification styles, matchers and integration with ScalaCheck.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
specs2 is a library for writing executable software specifications in Scala, created by Eric Torreborre. It emphasises specifications that read as documentation: acceptance specifications mix narrative text with examples, while unit specifications use a familiar "should" >> { ... } nesting style.
specs2 includes a rich matchers library (must_==, must beSome, must contain, must throwA), concurrent execution of examples by default, contexts for setup and teardown, tags, data tables for parameterised examples, and ScalaCheck integration for properties. Specifications can generate HTML or Markdown documentation, and it integrates with sbt, Maven, IDEs and JUnit runners. specs2 supports Scala 3 in its 5.x series; release SPECS2-5.10.0 was published on 11 September 2026.
The source code is at etorreborre/specs2 on GitHub under the MIT licence, with about 735 stars; the most recent commit was on 29 October 2026.
Its long-standing user guide documents each feature with runnable examples, and specs2 can also be run from JUnit-compatible tooling for CI reports.
Features
- Executable specifications: Narrative acceptance specs with examples.
- Matchers: Extensive
mustmatchers. - Concurrent examples: Examples run concurrently by default.
- ScalaCheck integration: Property-based examples.
Pros
- Free to use: Open source under the MIT licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 29 October 2026.
Cons
- Smaller community: Less widely used than ScalaTest or MUnit.
- Learning curve: Acceptance specification syntax takes time.
Usage and Links (Example)
import org.specs2.mutable.Specification
class PricingSpec extends Specification {
"Pricing.apply" should {
"apply a discount" >> {
Pricing.apply(100, 10) must_== 90
}
"reject negative prices" >> {
Pricing.apply(-1, 0) must throwA[IllegalArgumentException]
}
}
}
Resources:
Pricing
specs2 is free and open source under the MIT licence.
Recommended for?
- Scala teams that value specifications as documentation.
- Projects with acceptance-style specs mixing prose and examples.
Conclusion
specs2 is a thoughtful Scala specification library, best for teams that want tests to double as readable documentation.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with specs2 side by side.
SScalaTestScalaTest is an Apache-2.0 testing toolkit for Scala and Java with many testing styles (FunSuite, FlatSpec, WordSpec and more), rich matchers and integration with sbt, Maven and IDEs.Compare with specs2
MMUnitMUnit is an Apache-2.0 Scala testing library from Scalameta with a minimal JUnit-based API, actionable error messages with diffs, fixtures and support for JVM, Scala.js and Scala Native.Compare with specs2
SScalaCheckScalaCheck is a BSD-3-Clause property-based testing library for Scala and Java, inspired by Haskell's QuickCheck, with generators, shrinking and stateful testing, used by ScalaTest, specs2 and MUnit.Compare with specs2
JJUnit 5JUnit 5 is the current JUnit for Java and the JVM: Jupiter for new tests, Platform to launch them, Vintage to run JUnit 4.Compare with specs2
KKotestKotest is an Apache-2.0 Kotlin multiplatform test framework with multiple testing styles, a large assertions library and built-in property-based testing.Compare with specs2
CCucumberCucumber is the open-source BDD tool that runs Gherkin feature files against step definitions. It is not CucumberStudio.Compare with specs2