Export to GitHub

specs - UserGuide.wiki


Introduction

specs is designed as an alternative for JUnit when specifying and testing Java or Scala projects. Yet, it is able to reuse the existing JUnit infrastructure for execution and reporting since the specifications can be executed as JUnit4 test suites.

specs also integrates an advanced testing and specification library, the ScalaCheck project in order to be able to generate a numerous cases testing a given property.

specs takes its inspiration from existing frameworks:

  • rspec for trying to have a literate structure to specifications and assertions and also for the possibility to share examples between related specifications (as in the Stack example).

  • jmock for having reusable matchers and expressive assertions.

User Guide

This User Guide is divided in 7 parts:

  • 5 minutes to your first specification
  • Declare your specifications
  • The full guide to specs matchers
  • How to run your specifications
  • How use mock objects with jMock
  • How use mock objects with Mockito
  • Use DataTables and syntactic sugar in your specifications

    http://upload.wikimedia.org/wikipedia/commons/thumb/0/01/Nuvola_apps_important.png/20px-Nuvola_apps_important.png Alpha version!

  • How write literate specifications

For more examples about what you can do with the library, please:

Maven dependency

If you're a Maven user, you need to add the following dependency to your pom file: <dependency> <groupId>org.scala-tools.testing</groupId> <artifactId>specs</artifactId> <version>1.4.4</version> <!-- specify the version here --> </dependency>

Note: specs versions older than 1.4.4 are using the org.specs groupId