Remove definition of shouldParse (it's in hspec-attoparsec), and dependency on hspec-expectations.

This commit is contained in:
vi 2014-06-23 13:19:43 +08:00
parent a00ddec046
commit bee253e428
2 changed files with 2 additions and 16 deletions

View File

@ -68,7 +68,7 @@ test-suite spec
base == 4.*
, text
, hspec
, hspec-expectations
, hspec-attoparsec
, vector
, attoparsec
, unordered-containers

View File

@ -2,10 +2,10 @@
module Text.Taggy.ParserSpec where
import Control.Monad
import Data.Attoparsec.Text.Lazy
import Data.Text.Lazy
import Test.Hspec
import Test.Hspec.Attoparsec (shouldParse)
import Text.Taggy.Parser
import Text.Taggy.Types
@ -101,17 +101,3 @@ spec = do
(~>) :: Text -> Parser a -> Either String a
t ~> p = eitherResult $ parse p t
shouldParse :: (Eq a, Show a) => Either String a -> a -> Expectation
res `shouldParse` expectedVal =
either (expectationFailure . errmsg)
checkEquality
res
where errmsg err = " expected: " ++ show expectedVal
++ "\n but parse failed with error: " ++ err
checkEquality parsedVal =
when (parsedVal /= expectedVal) $
expectationFailure $ " expected: " ++ show expectedVal
++ "\n but got: " ++ show parsedVal