2013-02-12 05:06:22 +00:00
|
|
|
module Expectation where
|
|
|
|
|
|
|
|
import Test.Hspec
|
2013-02-12 07:24:33 +00:00
|
|
|
import System.Directory
|
|
|
|
import Control.Exception as E
|
2013-02-12 05:06:22 +00:00
|
|
|
|
|
|
|
shouldContain :: Eq a => [a] -> a -> Expectation
|
|
|
|
shouldContain containers element = do
|
|
|
|
let res = element `elem` containers
|
|
|
|
res `shouldBe` True
|
2013-02-12 07:24:33 +00:00
|
|
|
|
|
|
|
withDirectory :: FilePath -> IO a -> IO a
|
|
|
|
withDirectory dir action = bracket getCurrentDirectory
|
|
|
|
setCurrentDirectory
|
|
|
|
(\_ -> setCurrentDirectory dir >> action)
|