{-# OPTIONS_HADDOCK prune not-home #-}
module Test.Hspec.TmpProc
(
tdescribe
, module System.TmpProc
)
where
import System.TmpProc
import Test.Hspec
tdescribe :: HasCallStack => String -> SpecWith a -> SpecWith a
tdescribe :: String -> SpecWith a -> SpecWith a
tdescribe String
label SpecWith a
action = do
Bool
noDocker <- Bool -> Bool
not (Bool -> Bool) -> SpecM a Bool -> SpecM a Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> IO Bool -> SpecM a Bool
forall r a. IO r -> SpecM a r
runIO IO Bool
hasDocker
if Bool
noDocker then String -> SpecWith a -> SpecWith a
forall a. HasCallStack => String -> SpecWith a -> SpecWith a
tmpPending String
label SpecWith a
action else String -> SpecWith a -> SpecWith a
forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
label SpecWith a
action
tmpPending :: HasCallStack => String -> SpecWith a -> SpecWith a
tmpPending :: String -> SpecWith a -> SpecWith a
tmpPending String
label SpecWith a
spec = IO () -> SpecWith a -> SpecWith a
forall a. IO () -> SpecWith a -> SpecWith a
before_ (HasCallStack => String -> IO ()
String -> IO ()
pendingWith String
noDockerMessage) (SpecWith a -> SpecWith a) -> SpecWith a -> SpecWith a
forall a b. (a -> b) -> a -> b
$ String -> SpecWith a -> SpecWith a
forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
label SpecWith a
spec
noDockerMessage :: String
noDockerMessage :: String
noDockerMessage = String
"docker could not be detected"