Report the version of mongodb we run tests against

This commit is contained in:
Victor Denisov 2016-05-20 23:41:24 -07:00
parent 5cd545a16f
commit 18dffc982d
3 changed files with 17 additions and 2 deletions

View file

@ -62,7 +62,7 @@ Source-repository head
test-suite test test-suite test
hs-source-dirs: test hs-source-dirs: test
main-is: Spec.hs main-is: Main.hs
ghc-options: -Wall -with-rtsopts "-K32m" ghc-options: -Wall -with-rtsopts "-K32m"
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
build-depends: mongoDB build-depends: mongoDB

15
test/Main.hs Normal file
View file

@ -0,0 +1,15 @@
module Main where
import Database.MongoDB.Admin (serverVersion)
import Database.MongoDB.Connection (connect, host)
import Database.MongoDB.Query (access, slaveOk)
import Data.Text (unpack)
import Test.Hspec.Runner
import qualified Spec
main :: IO ()
main = do
p <- connect $ host "localhost"
version <- access p slaveOk "admin" serverVersion
putStrLn $ "Running tests with mongodb version: " ++ (unpack version)
hspecWith defaultConfig Spec.spec

View file

@ -1 +1 @@
{-# OPTIONS_GHC -F -pgmF hspec-discover #-} {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-}