git.iko.soy/typeable/haskell-stack-trace-plugin
on master help sign in
21 lines 582 B history raw
1{-# LANGUAGE OverloadedStrings #-}
2module StackTrace.PluginSpec (spec) where
4import Data.ByteString.Lazy (ByteString)
5import qualified Data.ByteString.Lazy as BL
6import Test.Hspec
7import System.Process.Typed
9spec :: Spec
10spec = do
11 output <- runIO exe
12 expected <- runIO $ BL.readFile "test/resource/ghc.output"
13 it "integration test" $ output `shouldBe` expected
16exe :: IO ByteString
17exe = do
18 runProcess_ $ shell "cabal install exe:example --installdir=./dist"
19 err <- readProcessStderr_ $ shell "./dist/example || true"
20 runProcess_ $ shell "rm -rf ./dist"
21 return err