Add global before/after hspec hook in test/Main.hs

This commit is contained in:
Joe Nelson
2014-08-17 21:21:47 -07:00
parent f42f7769e1
commit 9df8a7b99b
5 changed files with 14 additions and 10 deletions
+3 -3
View File
@@ -49,10 +49,10 @@ executable dbapi
Test-Suite spec
Type: exitcode-stdio-1.0
Default-Language: Haskell2010
Hs-Source-Dirs: src , test
Hs-Source-Dirs: test, src
Ghc-Options: -Wall
Main-Is: Spec.hs
Other-Modules: Dbapi, SpecHelper
Main-Is: Main.hs
Other-Modules: Dbapi, Spec, SpecHelper
Build-Depends: base, hspec2
, hspec-wai
, HDBC, HDBC-postgresql
-3
View File
@@ -10,9 +10,6 @@ import SpecHelper
import Network.HTTP.Types
import Dbapi (app)
main :: IO ()
main = hspec spec
spec :: Spec
spec = with (prepareAppDb "schema" $ app cfg) $ do
describe "GET /" $ do
+10
View File
@@ -0,0 +1,10 @@
module Main where
import Test.Hspec
import Spec
main :: IO ()
main = do
putStrLn "before spec"
hspec spec
putStrLn "after spec"
+1 -1
View File
@@ -1 +1 @@
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --no-main #-}
-3
View File
@@ -11,9 +11,6 @@ import Types (SqlRow(..))
import SpecHelper
main :: IO ()
main = hspec spec
spec :: Spec
spec = beforeAll (loadFixture "schema") $ do
describe "insert" $