Permalink
Browse files

Configuring hspec

  • Loading branch information...
adomokos committed Jan 23, 2018
1 parent 275d45a commit 9f7c14e6aa518da44338b7426822173053ecf6c0
Showing with 45 additions and 4 deletions.
  1. +4 −1 Makefile
  2. +18 −1 hashmir.cabal
  3. +10 −0 package.yaml
  4. +12 −0 test/Hashmir/DataSpec.hs
  5. +1 −2 test/Spec.hs
@@ -26,7 +26,10 @@ build: ## Builds the project with stack
run: build-db ## Runs the app
time ~/.local/bin/hashmir-exe

.PHONY: help
test: ## Run the specs
@stack test

.PHONY: help test

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@@ -1,4 +1,4 @@
-- This file has been generated from package.yaml by hpack version 0.17.1.
-- This file has been generated from package.yaml by hpack version 0.18.1.
--
-- see: https://github.com/sol/hpack

@@ -40,3 +40,20 @@ executable hashmir-exe
, HDBC-mysql
, hashmir
default-language: Haskell2010

test-suite hashmir-test
type: exitcode-stdio-1.0
main-is: Spec.hs
hs-source-dirs:
test/
ghc-options: -Wall
build-depends:
base >= 4.7 && < 5
, yeshql
, HDBC
, HDBC-mysql
, hashmir
, hspec == 2.*
other-modules:
Hashmir.DataSpec
default-language: Haskell2010
@@ -26,3 +26,13 @@ executables:
dependencies:
hashmir
ghc-options: -threaded -rtsopts -with-rtsopts=-N

tests:
hashmir-test:
source-dirs: test/
main: Spec.hs
dependencies:
- hashmir
- hspec == 2.*
other-modules:
Hashmir.DataSpec
@@ -0,0 +1,12 @@
module Hashmir.DataSpec where

import Test.Hspec

main :: IO ()
main = hspec spec

spec :: Spec
spec = do
describe "Hashmir Data" $ do
it "runs a test" $ do
True `shouldBe` True
@@ -1,2 +1 @@
main :: IO ()
main = putStrLn "Test suite not yet implemented"
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}

0 comments on commit 9f7c14e

Please sign in to comment.