Reorganize specs

This commit is contained in:
Fujimura Daisuke 2014-08-18 14:37:05 +08:00
parent 4696355085
commit f6d886e8bd
4 changed files with 6 additions and 14 deletions

View file

@ -55,10 +55,9 @@ Source-repository head
test-suite test test-suite test
hs-source-dirs: test hs-source-dirs: test
main-is: main.hs main-is: Spec.hs
ghc-options: -Wall ghc-options: -Wall
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
build-depends: mongoDB build-depends: mongoDB
, base , base
, mtl , mtl
@ -66,4 +65,3 @@ test-suite test
default-language: Haskell2010 default-language: Haskell2010
default-extensions: OverloadedStrings default-extensions: OverloadedStrings

View file

@ -1,11 +1,12 @@
module QueryTest (querySpec) where {-# LANGUAGE OverloadedStrings #-}
module QuerySpec (spec) where
import TestImport import TestImport
fakeDB :: MonadIO m => Action m a -> m a fakeDB :: MonadIO m => Action m a -> m a
fakeDB = access (error "Pipe") (error "AccessMode") "fake" fakeDB = access (error "Pipe") (error "AccessMode") "fake"
querySpec :: Spec spec :: Spec
querySpec = spec =
describe "useDb" $ describe "useDb" $
it "changes the db" $ do it "changes the db" $ do
db1 <- fakeDB thisDatabase db1 <- fakeDB thisDatabase

1
test/Spec.hs Normal file
View file

@ -0,0 +1 @@
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}

View file

@ -1,8 +0,0 @@
module Main where
import Test.Hspec (hspec)
import QueryTest
main :: IO ()
main = hspec $ do
querySpec