O'Reilly logo

Scala Test-Driven Development by Gaurav Sood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required