Skip to content

Commit 85feb31

Browse files
committed
Fix hspec-wai issue
1 parent 1f00a68 commit 85feb31

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

servant-server/servant-server.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ test-suite spec
117117
, directory
118118
, exceptions
119119
, hspec == 2.*
120-
, hspec-wai
120+
, hspec-wai >= 0.8 && <0.9
121121
, http-types
122122
, network >= 2.6
123123
, QuickCheck

servant-server/test/Servant/Server/ErrorSpec.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,17 @@ errorRetrySpec =
211211

212212
it "should continue when URLs don't match" $ do
213213
request methodPost "" [jsonCT, jsonAccept] jsonBody
214-
`shouldRespondWith` 200 { matchBody = Just $ encode (8 :: Int) }
214+
`shouldRespondWith` 200 { matchBody = mkBody $ encode (8 :: Int) }
215215

216216
it "should continue when methods don't match" $ do
217217
request methodGet "a" [jsonCT, jsonAccept] jsonBody
218-
`shouldRespondWith` 200 { matchBody = Just $ encode (4 :: Int) }
218+
`shouldRespondWith` 200 { matchBody = mkBody $ encode (4 :: Int) }
219+
where
220+
mkBody b = MatchBody $ \_ b' ->
221+
if b == b'
222+
then Nothing
223+
else Just "body not correct\n"
224+
219225

220226
-- }}}
221227
------------------------------------------------------------------------------

stack-ghc-7.8.4.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ extra-deps:
1010
- control-monad-omega-0.3.1
1111
- cryptonite-0.6
1212
- doctest-0.11.0
13-
- hspec-2.2.3
14-
- hspec-core-2.2.3
15-
- hspec-discover-2.2.3
16-
- hspec-expectations-0.7.2
13+
- hspec-2.3.2
14+
- hspec-discover-2.3.2
15+
- hspec-core-2.3.2
16+
- hspec-wai-0.8.0
17+
- hspec-expectations-0.8.2
18+
- call-stack-0.1.0
1719
- http-api-data-0.3
1820
- natural-transformation-0.4
1921
- primitive-0.6.1.0

stack.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ extra-deps:
1010
- http-api-data-0.3
1111
- servant-js-0.9 # needed for tutorial
1212
- natural-transformation-0.4
13+
- hspec-2.3.2
14+
- hspec-discover-2.3.2
15+
- hspec-core-2.3.2
16+
- hspec-wai-0.8.0
17+
- hspec-expectations-0.8.2
18+
- call-stack-0.1.0
1319
resolver: lts-6.0

0 commit comments

Comments
 (0)