From c99f3005c8c92462b352c0e2eaaf55c0d06ebd37 Mon Sep 17 00:00:00 2001 From: Martin Heuschober Date: Mon, 30 Jan 2017 03:00:58 +0100 Subject: [PATCH] compatibility servant 0.9 --- servant-ekg.cabal | 2 +- test/Servant/EkgSpec.hs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/servant-ekg.cabal b/servant-ekg.cabal index f57d037..2785b66 100644 --- a/servant-ekg.cabal +++ b/servant-ekg.cabal @@ -19,7 +19,7 @@ library hs-source-dirs: lib build-depends: base >=4.7 && < 4.10 , ekg-core - , servant > 0.5 && < 0.9 + , servant > 0.5 && < 0.10 , http-types , text , time diff --git a/test/Servant/EkgSpec.hs b/test/Servant/EkgSpec.hs index 5ee2f2b..54f5538 100644 --- a/test/Servant/EkgSpec.hs +++ b/test/Servant/EkgSpec.hs @@ -10,7 +10,9 @@ module Servant.EkgSpec (spec) where import Control.Concurrent +#if !MIN_VERSION_servant(0,9,0) import Control.Monad.Trans.Except +#endif import Data.Aeson import Data.Monoid import Data.Proxy @@ -40,7 +42,11 @@ spec = describe "servant-ekg" $ do it "collects number of request" $ do withApp $ \port mvar -> do mgr <- newManager defaultManagerSettings +#if MIN_VERSION_servant(0,9,0) + Right _result <- runClientM (getEp "name" Nothing) (ClientEnv mgr (BaseUrl Http "localhost" port "")) +#else _result <- runExceptT $ getEp "name" Nothing mgr (BaseUrl Http "localhost" port "") +#endif m <- readMVar mvar case H.lookup "hello.:name.GET" m of Nothing -> fail "Expected some value"