Skip to content

Commit

Permalink
Warning fix: Upgrade to hspec-2.2 everywhere
Browse files Browse the repository at this point in the history
We currently hide symbols that are not provided by hspec-2.1, triggering
a warning (hence an error under `-Werror`).

Additionally, we hide those symbols to provide our own version (slightly
different from hspec-2.2, though probably the changes are marginal).

Instead, just switch to hspec-2.2 everywhere, and add it to extra deps
if needed.
  • Loading branch information
Blaisorblade committed Aug 4, 2016
1 parent b7cd7ee commit 6fdea5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
12 changes: 1 addition & 11 deletions src/test/Network/HTTP/Download/VerifiedSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
module Network.HTTP.Download.VerifiedSpec where

import Crypto.Hash
import Control.Monad (unless)
import Control.Monad.IO.Class (MonadIO)
import Control.Monad.Logger (LoggingT, runStdoutLoggingT)
import Control.Monad.Trans.Reader
Expand All @@ -12,7 +11,7 @@ import Network.HTTP.Client.Conduit
import Network.HTTP.Download.Verified
import Path
import Path.IO
import Test.Hspec hiding (shouldNotBe, shouldNotReturn)
import Test.Hspec

-- TODO: share across test files
withTempDir' :: (Path Abs Dir -> IO a) -> IO a
Expand Down Expand Up @@ -78,15 +77,6 @@ setup = do
teardown :: T -> IO ()
teardown _ = return ()

shouldNotBe :: (Show a, Eq a) => a -> a -> Expectation
actual `shouldNotBe` expected =
unless (actual /= expected) (expectationFailure msg)
where
msg = "Value was exactly what it shouldn't be: " ++ show expected

shouldNotReturn :: (Show a, Eq a) => IO a -> a -> Expectation
action `shouldNotReturn` unexpected = action >>= (`shouldNotBe` unexpected)

spec :: Spec
spec = beforeAll setup $ afterAll teardown $ do
let exampleProgressHook _ = return ()
Expand Down
5 changes: 5 additions & 0 deletions stack-7.8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ resolver: lts-2.22
# - base: "fpco/stack-base" # see ./etc/docker/stack-base/Dockerfile
# name: "fpco/stack-test"
extra-deps:
- hspec-2.2.3
- hspec-core-2.2.3
- hspec-discover-2.2.3
- hspec-expectations-0.7.2
- hspec-smallcheck-0.4.1
- path-0.5.8
- path-io-1.1.0
- directory-1.2.2.0
Expand Down
4 changes: 2 additions & 2 deletions stack.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ test-suite stack-test
, directory >= 1.2.1.0
, exceptions
, filepath
, hspec <2.3
, hspec >= 2.2 && <2.3
, http-conduit
, monad-logger
, path >= 0.5.7
Expand Down Expand Up @@ -341,7 +341,7 @@ test-suite stack-integration-test
, containers >= 0.5.5.1
, directory >= 1.2.1.0
, filepath >= 1.3.0.2
, hspec < 2.3
, hspec >= 2.2 && < 2.3
, process >= 1.2.0.0 && < 1.5
, resourcet
, temporary
Expand Down

0 comments on commit 6fdea5b

Please sign in to comment.