Skip to content

Commit

Permalink
Merge pull request #1583 from haskell-servant/hspec-no-color
Browse files Browse the repository at this point in the history
Disable hspec colored output in servant-swagger doctests
  • Loading branch information
Gaël Deest committed Apr 19, 2022
2 parents c19ed0f + 78280dc commit 117a2cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions servant-swagger/src/Servant/Swagger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import Servant.Swagger.Internal.Orphans ()
-- >>> import Data.Typeable
-- >>> import GHC.Generics
-- >>> import Servant.API
-- >>> import System.Environment
-- >>> import Test.Hspec
-- >>> import Test.QuickCheck
-- >>> import qualified Data.ByteString.Lazy.Char8 as BSL8
Expand All @@ -64,6 +65,7 @@ import Servant.Swagger.Internal.Orphans ()
-- >>> :set -XGeneralizedNewtypeDeriving
-- >>> :set -XOverloadedStrings
-- >>> :set -XTypeOperators
-- >>> setEnv "HSPEC_COLOR" "no"
-- >>> data User = User { name :: String, age :: Int } deriving (Show, Generic, Typeable)
-- >>> newtype UserId = UserId Integer deriving (Show, Generic, Typeable, ToJSON)
-- >>> instance ToJSON User
Expand Down
2 changes: 2 additions & 0 deletions servant-swagger/src/Servant/Swagger/Internal/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ import Servant.Swagger.Internal.TypeLevel
-- >>> import Control.Applicative
-- >>> import GHC.Generics
-- >>> import Test.QuickCheck
-- >>> import System.Environment (setEnv)
-- >>> :set -XDeriveGeneric
-- >>> :set -XGeneralizedNewtypeDeriving
-- >>> :set -XDataKinds
-- >>> :set -XTypeOperators
-- >>> setEnv "HSPEC_COLOR" "no"

-- | Verify that every type used with @'JSON'@ content type in a servant API
-- has compatible @'ToJSON'@ and @'ToSchema'@ instances using @'validateToJSON'@.
Expand Down

0 comments on commit 117a2cc

Please sign in to comment.