Skip to content

Testing

edechter edited this page Jun 12, 2014 · 1 revision

Writing unit tests

We are using HSpec to write and run unit tests for Strappy. For an example, see the beginnings of the test suite for the strappy-core project. For each project, tests are located in the project top level directory in a test/ directory. The single file in that directory should contain only a GHC pragma {-# OPTIONS_GHC -F -pgmF hspec-discover #-}. This pragma instructs the cabal test-suite runner to search for spec code in this and subdirectories. hspec-discover will look at any file whose name ends in Spec.hs and whose modules export a spec :: Spec variable.

Clone this wiki locally