-
Book Overview & Buying
-
Table Of Contents
Scala Test-Driven Development
By :
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 for a particular need. For example, in Specs2, you can say:
aFile mustBe aDirectory
Where Specs2 has individual Matchers for java.io.Files, ScalaTest does not have similar Matchers.
Another difference between ScalaTest and Spec is implicit...