Skip to content
This repository
Browse code

Adapt for hspec-1.3

  • Loading branch information...
commit a0aad56bf2ab3a74b21e46835b8cd79d3a419eda 1 parent 816d235
Simon Hengel authored
4 doctest.cabal
@@ -85,8 +85,8 @@ test-suite spec
85 85 , ghc-paths == 0.1.*
86 86 , transformers
87 87 , HUnit == 1.2.*
88   - , hspec-discover
89   - , hspec-shouldbe
  88 + , hspec >= 1.3
  89 + , QuickCheck
90 90 , stringbuilder
91 91 , silently
92 92 , filepath
2  test/ExtractSpec.hs
... ... @@ -1,6 +1,6 @@
1 1 module ExtractSpec (main, spec) where
2 2
3   -import Test.Hspec.ShouldBe
  3 +import Test.Hspec
4 4 import Test.HUnit
5 5
6 6 import Panic (GhcException (..))
2  test/InterpreterSpec.hs
... ... @@ -1,6 +1,6 @@
1 1 module InterpreterSpec (main, spec) where
2 2
3   -import Test.Hspec.ShouldBe
  3 +import Test.Hspec
4 4
5 5 import Data.List (isSuffixOf)
6 6 import System.Process (readProcess)
2  test/LocationSpec.hs
... ... @@ -1,6 +1,6 @@
1 1 module LocationSpec (main, spec) where
2 2
3   -import Test.Hspec.ShouldBe
  3 +import Test.Hspec
4 4
5 5 import Location
6 6 import SrcLoc
2  test/MainSpec.hs
... ... @@ -1,6 +1,6 @@
1 1 module MainSpec (main, spec) where
2 2
3   -import Test.Hspec.ShouldBe hiding (Summary)
  3 +import Test.Hspec
4 4 import Test.HUnit (assertEqual, Assertion)
5 5
6 6 import Control.Exception
5 test/ParseSpec.hs
@@ -2,8 +2,7 @@
2 2 {-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
3 3 module ParseSpec (main, spec) where
4 4
5   -import Test.Hspec.ShouldBe
6   -import Test.HUnit
  5 +import Test.Hspec
7 6 import Data.String.Builder (Builder, build)
8 7 import Control.Monad.Trans.Writer
9 8
@@ -25,7 +24,7 @@ prop_ = tell . return . Property . noLocation
25 24 module_ :: String -> Writer [DocTest] () -> Writer [Module DocTest] ()
26 25 module_ name = tell . return . Module name . execWriter
27 26
28   -shouldGive :: IO [Module DocTest] -> Writer [Module DocTest] () -> Assertion
  27 +shouldGive :: IO [Module DocTest] -> Writer [Module DocTest] () -> Expectation
29 28 shouldGive action w = do
30 29 r <- map noLoc `fmap` action
31 30 r `shouldBe` execWriter w
2  test/PropertySpec.hs
@@ -2,7 +2,7 @@
2 2 {-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
3 3 module PropertySpec (main, spec) where
4 4
5   -import Test.Hspec.ShouldBe
  5 +import Test.Hspec
6 6 import Data.String.Builder
7 7
8 8 import Property
5 test/ReportSpec.hs
@@ -2,9 +2,8 @@
2 2 {-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
3 3 module ReportSpec (main, spec) where
4 4
5   -import Test.Hspec.ShouldBe
  5 +import Test.Hspec
6 6 import Data.String.Builder
7   -import Test.HUnit
8 7
9 8 import Data.Monoid
10 9 import System.IO
@@ -22,7 +21,7 @@ capture = fmap fst . hCapture [stderr] . (`execStateT` ReportState 0 True mempty
22 21 capture_ :: Report a -> IO String
23 22 capture_ = fmap fst . hCapture [stderr] . (`execStateT` ReportState 0 False mempty)
24 23
25   -shouldGive :: IO String -> Builder -> Assertion
  24 +shouldGive :: IO String -> Builder -> Expectation
26 25 action `shouldGive` expected = action `shouldReturn` build expected
27 26
28 27 spec :: Spec
3  test/RunSpec.hs
... ... @@ -1,6 +1,7 @@
1 1 module RunSpec (main, spec) where
2 2
3   -import Test.Hspec.ShouldBe hiding (Summary)
  3 +import Test.Hspec
  4 +import Test.QuickCheck
4 5 import System.Exit
5 6
6 7 import Control.Exception
2  test/UtilSpec.hs
... ... @@ -1,6 +1,6 @@
1 1 module UtilSpec (main, spec) where
2 2
3   -import Test.Hspec.ShouldBe
  3 +import Test.Hspec
4 4
5 5 import Util
6 6

0 comments on commit a0aad56

Please sign in to comment.
Something went wrong with that request. Please try again.