From 0dfd2434acc3dcaafebe86133ce9e9c1aa0c2f8f Mon Sep 17 00:00:00 2001 From: Alp Mestanogullari Date: Thu, 27 Nov 2014 18:50:29 +0100 Subject: [PATCH] fix build error for servant's spec --- src/Servant/Utils/StaticFiles.hs | 3 --- test/Servant/Utils/StaticFilesSpec.hs | 16 ---------------- 2 files changed, 19 deletions(-) diff --git a/src/Servant/Utils/StaticFiles.hs b/src/Servant/Utils/StaticFiles.hs index 8d9318b7..a8a05ed4 100644 --- a/src/Servant/Utils/StaticFiles.hs +++ b/src/Servant/Utils/StaticFiles.hs @@ -6,11 +6,8 @@ module Servant.Utils.StaticFiles ( serveDirectory, ) where -import Data.String.Conversions import Filesystem.Path.CurrentOS (decodeString) -import Network.Wai import Network.Wai.Application.Static - import Servant.API.Raw import Servant.Server diff --git a/test/Servant/Utils/StaticFilesSpec.hs b/test/Servant/Utils/StaticFilesSpec.hs index a269599f..8d34f90f 100644 --- a/test/Servant/Utils/StaticFilesSpec.hs +++ b/test/Servant/Utils/StaticFilesSpec.hs @@ -6,12 +6,8 @@ module Servant.Utils.StaticFilesSpec where import Control.Exception -import Data.Foldable -import Data.List import Data.Proxy -import Data.String.Conversions import Network.Wai -import Network.Wai.Test import System.Directory import System.IO.Temp import Test.Hspec hiding (pending) @@ -22,7 +18,6 @@ import Servant.API.Capture import Servant.API.Get import Servant.API.Raw import Servant.API.Sub -import Servant.Docs import Servant.Server import Servant.ServerSpec import Servant.Utils.StaticFiles @@ -30,10 +25,7 @@ import Servant.Utils.StaticFiles type Api = "dummy_api" :> Capture "person_name" String :> Get Person :<|> "static" :> Raw - :<|> "documentation" :> Raw -instance ToCapture (Capture "person_name" String) where - toCapture _proxy = DocCapture "person_name" "person_name_doc" api :: Proxy Api api = Proxy @@ -45,7 +37,6 @@ server :: Server Api server = (\ name -> return (Person name 42)) :<|> serveDirectory "static" - :<|> serveDocumentation api withStaticFiles :: IO () -> IO () withStaticFiles action = withSystemTempDirectory "servant-test" $ \ tmpDir -> @@ -71,10 +62,3 @@ spec = do it "serves the contents of index.html when requesting the root of a directory" $ do get "/static" `shouldRespondWith` "index" - - describe "serveDocumentation" $ do - it "serves documentation about the expose API" $ do - response <- get "/documentation" - liftIO $ forM_ ["person_name" :: String, "static", "dummy_api", "person_name_doc"] $ - \ snippet -> - (snippet, cs (simpleBody response)) `shouldSatisfy` uncurry isInfixOf