Running Specs2 tests

SBT recognizes Specs2 as a test framework; therefore, it is the most common way to run Specs2 tests. The fact that SBT considers Specs2 a test framework enables SBT to execute any class or object that is extending the Specification abstract class. The test target of SBT will execute any specification within the src/test/scala directory:

sbt> test

You can also run individual tests using the test-only target:

sbt> test-only org.packt. EmployeeAgeDataTableSpecification

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.