[Haskell-cafe] HSpec & Monads
Jan von Löwenstein
jan.loewenstein at gmail.com
Mon Apr 3 16:06:04 UTC 2017
I have got a typeclass (MonadResource) that represents a client side rest
resource and encapsulates http interaction with a server.
Inside a `runResource` I want to do arbitrary calls to the server.
I have a separate implementation running in `runResourceStub` that is a
fake implementation allowing for tests that don't need a real server.
I am unsure how to (best) integrate that with HSpec.
it "can create related backend resources" $ do
runResourceStub $ do
pod <- createPod "my-pod" ...
secret <- createSecret...
(getPod secret) `shouldBe` pod
That is what I would like to do. How do I do it? What else should I
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe