Cabal is the build system for Haskell, it also doubles as a package manager. Create a .cabal file:
Enable automatic Hspec discovery, so that each module
ending with Spec can be automatically considered as a test module:
Add a simple (icebreaker) test, because there’s always a bit of work involved in
getting everything up and running:
Create a Cabal sandbox, install dependencies, build the package, and enable the
tests, by running the following commands in a terminal:
Run the tests via Cabal’s built-in test runner:
See the test failing, as a form of Double Entry Bookkeeping:
To use QuickCheck interactively, start a REPL by doing:
In the above command,
spec is just the name of the test-suite, as declared in the .cabal file.
For convenience, all the above are also available on GitHub.