on master help sign in
Use hspec-discover
commitca8d3cb9224633e32c221aa56f6f9aafb6403806 authorSimon Hengel <sol@typeful.net> dateThu 20 Nov 2014, 17:49 (12 years ago) parente95a52b
3 files changed+10−3
test/main.hs → test/Data/YamlSpec.hs+6−1 test/Spec.hs+1 yaml.cabal+3−2
test/main.hs → test/Data/YamlSpec.hsrenamed+6−1
@@ -4,6 +4,8 @@
44{-# LANGUAGE OverloadedStrings #-}
55{-# LANGUAGE TemplateHaskell #-}
66
7+module Data.YamlSpec (main, spec) where
8+
79import qualified Text.Libyaml as Y
810import qualified Data.ByteString.Char8 as B8
911
@@ -41,7 +43,10 @@ data TestJSON = TestJSON
4143deriveJSON defaultOptions ''TestJSON
4244
4345main :: IO ()
44−main = hspec $ do
46+main = hspec spec
47+
48+spec :: Spec
49+spec = do
4550 describe "streaming" $ do
4651 it "count scalars with anchor" caseCountScalarsWithAnchor
4752 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
104104 , aeson >= 0.5
105105
106106
107−test-suite test
107+test-suite spec
108108 type: exitcode-stdio-1.0
109109 hs-source-dirs: test
110− main-is: main.hs
110+ main-is: Spec.hs
111+ other-modules: Data.YamlSpec
111112 cpp-options: -DTEST
112113 build-depends: hspec >= 1.3
113114 , HUnit