Differences between Specs2 and ScalaTest

The main differences between ScalaTest and Specs2 are:

  • The overall structure of the test in Specs2 is different to that in ScalaTest.
  • Specs2 has a different set of Matchers with different syntax.
  • Specs2 tests are primarily dedicated to behavior-driven development (BDD), whereas ScalaTest tests are more generic.
  • ScalaTest provides much more choice and versatility. For example, to write BDD-like Specs2 in ScalaTest, one can use Spec, FeatureSpec, WordSpec, FlatSpec, and GivenWhenThen traits along with ShouldMatchers or MustMatcher. This gives the developer more flexibility to follow his/her own style of writing specifications.
  • Specs2 has a significantly higher number of Matchers than ScalaTest. Most of them are ...

Get Scala Test-Driven Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.