File: SpecHook.hs

package info (click to toggle)
haskell-hspec-core 2.11.9-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 656 kB
  • sloc: haskell: 8,945; makefile: 5
file content (17 lines) | stat: -rw-r--r-- 450 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module SpecHook (hook) where

import           Prelude ()
import           Helper

import           System.Environment (getEnvironment)

ignoreHspecConfig :: IO a -> IO a
ignoreHspecConfig action = do
  env <- getEnvironment
  let filteredEnv = ("IGNORE_DOT_HSPEC", "yes") : filter p env
  withEnvironment filteredEnv action
  where
    p (name, _value) = name == "COMSPEC" || name == "PATH"

hook :: Spec -> Spec
hook = aroundAll_ ignoreHspecConfig