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

Chapter 8. Scala TDD with Specs2

Specs2 is another popular library, which is used to write an executable specification for Scala. Specs2 is contrarily focused than ScalaTest. It also has a different perspective. It is another arsenal in your gambit of writing tests for Scala code. In this chapter, we will look at:

  • Introduction to Specs2
  • Differences between Specs2 and ScalaTest
  • Setting up Specs2
  • Unit specification
  • Functional specification
  • Matchers

Introduction to Specs2

Much like ScalaTest, Specs2 also works with SBT. There are both similarities and differences between Specs2 and ScalaTest. Some unique differences between Specs2 and ScalaTest give the developer choice of one over the other depending on the functionality required.

Note

There is a very interesting ...

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