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
|
Test-Suite spec
|
||||||
Type: exitcode-stdio-1.0
|
Type: exitcode-stdio-1.0
|
||||||
Default-Language: Haskell2010
|
Default-Language: Haskell2010
|
||||||
Hs-Source-Dirs: src , test
|
Hs-Source-Dirs: test, src
|
||||||
Ghc-Options: -Wall
|
Ghc-Options: -Wall
|
||||||
Main-Is: Spec.hs
|
Main-Is: Main.hs
|
||||||
Other-Modules: Dbapi, SpecHelper
|
Other-Modules: Dbapi, Spec, SpecHelper
|
||||||
Build-Depends: base, hspec2
|
Build-Depends: base, hspec2
|
||||||
, hspec-wai
|
, hspec-wai
|
||||||
, HDBC, HDBC-postgresql
|
, HDBC, HDBC-postgresql
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ import SpecHelper
|
|||||||
import Network.HTTP.Types
|
import Network.HTTP.Types
|
||||||
import Dbapi (app)
|
import Dbapi (app)
|
||||||
|
|
||||||
main :: IO ()
|
|
||||||
main = hspec spec
|
|
||||||
|
|
||||||
spec :: Spec
|
spec :: Spec
|
||||||
spec = with (prepareAppDb "schema" $ app cfg) $ do
|
spec = with (prepareAppDb "schema" $ app cfg) $ do
|
||||||
describe "GET /" $ 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
|
import SpecHelper
|
||||||
|
|
||||||
main :: IO ()
|
|
||||||
main = hspec spec
|
|
||||||
|
|
||||||
spec :: Spec
|
spec :: Spec
|
||||||
spec = beforeAll (loadFixture "schema") $ do
|
spec = beforeAll (loadFixture "schema") $ do
|
||||||
describe "insert" $
|
describe "insert" $
|
||||||
|
|||||||
Reference in New Issue
Block a user