Closed L7R7 closed 2 years ago
It's a draft for now because I'm sure I'm not done yet. I'm struggling with the nix setup on my machine so I can't get proper feedback locallly yet
Looks pretty good!
Ok, so I am actually quite happy with what is there. I'd like to add a test that makes sure that access is forbidden when using wrong credentials but I'm stuck because I can't figure out how to properly catch the error servant-client will throw in this case.
I also thought about reducing code duplication a bit by delegatng clientEnvSetupFunc
to clientEnvSetupFuncWithContext
using EmptyContext
, but I think it's good enough the way it is now. If you want that, I can add it.
Oh, let me know if you think it's tested well enough already. I'd remove clientGetWrongCredentials
then
I can't figure out how to properly catch the error servant-client will throw in this case.
You use runClientM
manually:
it "foobar" $ \clientEnv -> do
errOrResult <- runClientM functionHere clientEnv
Thanks for the hint! I'll have to figure out how that works, but I can say it's nice to use :+1:
I'm happy with the changes now. Let me know what you think
@L7R7 Before we continue, just to be sure: are you aware of and in agreement with the license?
Yes, I am and I'm fine with it
Merged and released, Great thanks!
This addresses #42. I tried to be as minimal as possible in the test (maybe it's even a bit too simplistic, but it's enough to show that it works)
Closes #42