
3 Apr
2017
3 Apr
'17
12:06 p.m.
Hi, 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 consider doing? Best Jan