on master help sign in
Use hspec-discover
ca8d3cbSimon Hengel
test/main.hs → test/Data/YamlSpec.hsrenamed+6−1
@@ -4,6 +4,8 @@
4{-# LANGUAGE OverloadedStrings #-}
4{-# LANGUAGE OverloadedStrings #-}
5{-# LANGUAGE TemplateHaskell #-}
5{-# LANGUAGE TemplateHaskell #-}
6
6
7+module Data.YamlSpec (main, spec) where
8+
7import qualified Text.Libyaml as Y
9import qualified Text.Libyaml as Y
8import qualified Data.ByteString.Char8 as B8
10import qualified Data.ByteString.Char8 as B8
9
11
@@ -41,7 +43,10 @@ data TestJSON = TestJSON
41deriveJSON defaultOptions ''TestJSON
43deriveJSON defaultOptions ''TestJSON
42
44
43main :: IO ()
45main :: IO ()
44−main = hspec $ do
46+main = hspec spec
47+
48+spec :: Spec
49+spec = do
45 describe "streaming" $ do
50 describe "streaming" $ do
46 it "count scalars with anchor" caseCountScalarsWithAnchor
51 it "count scalars with anchor" caseCountScalarsWithAnchor
47 it "count sequences with anchor" caseCountSequencesWithAnchor
52 it "count sequences with anchor" caseCountSequencesWithAnchor
test/Spec.hsnew file+1
@@ -0,0 +1 @@
1+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
yaml.cabal+3−2
@@ -104,10 +104,11 @@ executable json2yaml
104 , aeson >= 0.5
104 , aeson >= 0.5
105
105
106
106
107−test-suite test
107+test-suite spec
108 type: exitcode-stdio-1.0
108 type: exitcode-stdio-1.0
109 hs-source-dirs: test
109 hs-source-dirs: test
110− main-is: main.hs
110+ main-is: Spec.hs
111+ other-modules: Data.YamlSpec
111 cpp-options: -DTEST
112 cpp-options: -DTEST
112 build-depends: hspec >= 1.3
113 build-depends: hspec >= 1.3
113 , HUnit
114 , HUnit