A Haskell/Hspec skeleton project
Haskell
Latest commit ca06d5c Feb 23, 2017 @sol sol Use caching on Travis
Permalink
Failed to load latest commit information.
src/Data/String Initial commit May 20, 2013
test Use test/Spec.hs instead of test/Main.hs for now Oct 20, 2014
.ghci Initial commit May 20, 2013
.gitignore add stack support Jan 31, 2016
.travis.yml Use caching on Travis Feb 23, 2017
LICENSE Initial commit May 20, 2013
README.md add stack support Jan 31, 2016
Setup.lhs Initial commit May 20, 2013
package.yaml Use hpack Feb 15, 2017
stack.yaml add stack support Jan 31, 2016
strip.cabal Use hpack Feb 15, 2017

README.md

Build Status

Running tests

First make sure that all dependencies are installed:

$ cabal install --only-dependencies --enable-tests

cabal

Just run

$ cabal test

and return code will indicate success or failure. However, you won't get nice test output.

runhaskell

If you want nice output you can use runhaskell:

$ runhaskell -isrc -itest test/Spec.hs

Alternatively, you can build and run the test suite manually:

$ cabal configure --enable-tests --disable-optimization && cabal build && ./dist/build/spec/spec

ghci

The fastest way to run your specs is with ghci. Make sure that .ghci is only writeable by you:

$ chmod go-w .ghci

Then you can run the specs with:

$ ghci test/Spec.hs
*Main> :main

After modifying code use:

*Main> :reload
*Main> :main

(note that the :reload will be much faster than loading the code initially, this makes a big difference for larger projects)

Cabal sandboxes

To use runhaskell or ghci with Cabal sandboxes, run it with cabal exec:

$ cabal exec ghci test/Spec.hs
*Main> :main
$ cabal exec -- runhaskell -isrc -itest test/Spec.hs

Stack

To use stack to run your tests, you can simply run:

$ stack setup && stack test