grakn-0.3.0: features/ClientSpec.hs
module ClientSpec
( spec
) where
import Data.Either (isLeft)
import Grakn
import Servant.Client (BaseUrl (BaseUrl), Scheme (Http))
import Test.Hspec
spec :: Spec
spec =
describe
"As a Grakn Developer I should be able to connect to a running Grakn Instance and use that instance to issue queries." $
it "Issuing a query with a broken connection" $ do
let client = aBrokenConnectionToTheDatabase
result <- execute client "match $x sub entitty"
result `shouldSatisfy` isLeft
aBrokenConnectionToTheDatabase :: Client
aBrokenConnectionToTheDatabase =
Client (BaseUrl Http "1.2.3.4" 5678 "") "akeyspace"