From f6d886e8bd30fadf63a2e7585a183898a50be9ba Mon Sep 17 00:00:00 2001 From: Fujimura Daisuke Date: Mon, 18 Aug 2014 14:37:05 +0800 Subject: [PATCH] Reorganize specs --- mongoDB.cabal | 4 +--- test/{QueryTest.hs => QuerySpec.hs} | 7 ++++--- test/Spec.hs | 1 + test/main.hs | 8 -------- 4 files changed, 6 insertions(+), 14 deletions(-) rename test/{QueryTest.hs => QuerySpec.hs} (78%) create mode 100644 test/Spec.hs delete mode 100644 test/main.hs diff --git a/mongoDB.cabal b/mongoDB.cabal index 16a6b54..d2fd10c 100644 --- a/mongoDB.cabal +++ b/mongoDB.cabal @@ -55,10 +55,9 @@ Source-repository head test-suite test hs-source-dirs: test - main-is: main.hs + main-is: Spec.hs ghc-options: -Wall type: exitcode-stdio-1.0 - build-depends: mongoDB , base , mtl @@ -66,4 +65,3 @@ test-suite test default-language: Haskell2010 default-extensions: OverloadedStrings - diff --git a/test/QueryTest.hs b/test/QuerySpec.hs similarity index 78% rename from test/QueryTest.hs rename to test/QuerySpec.hs index e957232..1e55a2f 100644 --- a/test/QueryTest.hs +++ b/test/QuerySpec.hs @@ -1,11 +1,12 @@ -module QueryTest (querySpec) where +{-# LANGUAGE OverloadedStrings #-} +module QuerySpec (spec) where import TestImport fakeDB :: MonadIO m => Action m a -> m a fakeDB = access (error "Pipe") (error "AccessMode") "fake" -querySpec :: Spec -querySpec = +spec :: Spec +spec = describe "useDb" $ it "changes the db" $ do db1 <- fakeDB thisDatabase diff --git a/test/Spec.hs b/test/Spec.hs new file mode 100644 index 0000000..a824f8c --- /dev/null +++ b/test/Spec.hs @@ -0,0 +1 @@ +{-# OPTIONS_GHC -F -pgmF hspec-discover #-} diff --git a/test/main.hs b/test/main.hs deleted file mode 100644 index 5e74cec..0000000 --- a/test/main.hs +++ /dev/null @@ -1,8 +0,0 @@ -module Main where -import Test.Hspec (hspec) - -import QueryTest - -main :: IO () -main = hspec $ do - querySpec