diff --git a/dbapi.cabal b/dbapi.cabal index 3f163d12d..6762569bf 100644 --- a/dbapi.cabal +++ b/dbapi.cabal @@ -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 diff --git a/test/Feature/RangeSpec.hs b/test/Feature/RangeSpec.hs index e88b59c62..78b9dacff 100644 --- a/test/Feature/RangeSpec.hs +++ b/test/Feature/RangeSpec.hs @@ -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 diff --git a/test/Main.hs b/test/Main.hs new file mode 100644 index 000000000..23987469c --- /dev/null +++ b/test/Main.hs @@ -0,0 +1,10 @@ +module Main where + +import Test.Hspec +import Spec + +main :: IO () +main = do + putStrLn "before spec" + hspec spec + putStrLn "after spec" diff --git a/test/Spec.hs b/test/Spec.hs index a824f8c30..b4e92e756 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -1 +1 @@ -{-# OPTIONS_GHC -F -pgmF hspec-discover #-} +{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --no-main #-} diff --git a/test/Unit/PgQuerySpec.hs b/test/Unit/PgQuerySpec.hs index 502c6ae2d..5ef6f7cf5 100644 --- a/test/Unit/PgQuerySpec.hs +++ b/test/Unit/PgQuerySpec.hs @@ -11,9 +11,6 @@ import Types (SqlRow(..)) import SpecHelper -main :: IO () -main = hspec spec - spec :: Spec spec = beforeAll (loadFixture "schema") $ do describe "insert" $