Skip to content

Commit 4f0dcc1

Browse files
committed
Update hspec-formatters-codewars to v0.3.0
1 parent 5db0a39 commit 4f0dcc1

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

workspace/stack.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
resolver: lts-20.10
22

33
extra-deps:
4-
- url: https://github.com/codewars/hspec-formatters-codewars/archive/v0.2.1.tar.gz
4+
- url: https://github.com/codewars/hspec-formatters-codewars/archive/v0.3.0.tar.gz
55
- url: https://github.com/codewars/hspec-codewars/archive/v0.1.0.tar.gz
66

77
# Control whether we use the GHC we find on the path

workspace/test/Main.hs

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
module Main where
2-
3-
import Test.Hspec.Runner
4-
import Test.Hspec.Formatters.Codewars (codewars)
1+
module Main (main) where
52

63
import qualified Spec
4+
import System.Exit
5+
import Test.Hspec.Core.Formatters.V2 (formatException, formatterToFormat)
6+
import Test.Hspec.Core.Util (safeTry)
7+
import Test.Hspec.Formatters.Codewars (escapeLF, newFormatter)
8+
import Test.Hspec.Runner
79

810
main :: IO ()
9-
main = hspecWith defaultConfig {configFormatter = Just codewars} Spec.spec
11+
main = do
12+
codewars <- newFormatter
13+
summary <- safeTry $ runSpec Spec.spec defaultConfig {configFormat = Just $ formatterToFormat codewars}
14+
case summary of
15+
Left ex -> do
16+
putStrLn $ "\n<ERROR::>Test suite crashed<:LF:>" ++ (escapeLF $ formatException ex)
17+
exitFailure
18+
Right s -> evaluateSummary s

0 commit comments

Comments
 (0)