mongodb/test/QuerySpec.hs
2014-08-19 12:48:36 +08:00

16 lines
390 B
Haskell

{-# LANGUAGE OverloadedStrings #-}
module QuerySpec (spec) where
import TestImport
fakeDB :: MonadIO m => Action m a -> m a
fakeDB = access (error "Pipe") (error "AccessMode") "fake"
spec :: Spec
spec =
describe "useDb" $
it "changes the db" $ do
db1 <- fakeDB thisDatabase
db1 `shouldBe` "fake"
db2 <- fakeDB $ useDb "use" thisDatabase
db2 `shouldBe` "use"