Add global before/after hspec hook in test/Main.hs
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -1 +1 @@
|
||||
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
|
||||
{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --no-main #-}
|
||||
|
||||
@@ -11,9 +11,6 @@ import Types (SqlRow(..))
|
||||
|
||||
import SpecHelper
|
||||
|
||||
main :: IO ()
|
||||
main = hspec spec
|
||||
|
||||
spec :: Spec
|
||||
spec = beforeAll (loadFixture "schema") $ do
|
||||
describe "insert" $
|
||||
|
||||
Reference in New Issue
Block a user