From 1f00a6893765b2d16c5b1f20e6496585d2d1dcfc Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Sun, 1 Jan 2017 20:02:56 +0200 Subject: [PATCH 1/2] Support aeson-1.1 --- servant-client/servant-client.cabal | 2 +- servant-server/servant-server.cabal | 2 +- servant/servant.cabal | 2 +- stack-ghc-8.0.1.yaml | 6 ++---- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/servant-client/servant-client.cabal b/servant-client/servant-client.cabal index 2bbd00cb..65983a3d 100644 --- a/servant-client/servant-client.cabal +++ b/servant-client/servant-client.cabal @@ -37,7 +37,7 @@ library build-depends: base >= 4.7 && < 4.10 , base-compat >= 0.9.1 && < 0.10 - , aeson >= 0.7 && < 1.1 + , aeson >= 0.7 && < 1.2 , attoparsec >= 0.12 && < 0.14 , base64-bytestring >= 1.0.0.1 && < 1.1 , bytestring >= 0.10 && < 0.11 diff --git a/servant-server/servant-server.cabal b/servant-server/servant-server.cabal index c790e0a3..89b6a7f5 100644 --- a/servant-server/servant-server.cabal +++ b/servant-server/servant-server.cabal @@ -47,7 +47,7 @@ library build-depends: base >= 4.7 && < 4.10 , base-compat >= 0.9 && < 0.10 - , aeson >= 0.7 && < 1.1 + , aeson >= 0.7 && < 1.2 , attoparsec >= 0.12 && < 0.14 , base64-bytestring >= 1.0 && < 1.1 , bytestring >= 0.10 && < 0.11 diff --git a/servant/servant.cabal b/servant/servant.cabal index e93e1cf7..9126a17f 100644 --- a/servant/servant.cabal +++ b/servant/servant.cabal @@ -51,7 +51,7 @@ library build-depends: base >= 4.7 && < 4.10 , base-compat >= 0.9 && < 0.10 - , aeson >= 0.7 && < 1.1 + , aeson >= 0.7 && < 1.2 , attoparsec >= 0.12 && < 0.14 , bytestring >= 0.10 && < 0.11 , case-insensitive >= 1.2 && < 1.3 diff --git a/stack-ghc-8.0.1.yaml b/stack-ghc-8.0.1.yaml index 21f2dab0..c6024959 100644 --- a/stack-ghc-8.0.1.yaml +++ b/stack-ghc-8.0.1.yaml @@ -1,4 +1,4 @@ -resolver: nightly-2016-05-27 +resolver: nightly-2016-12-31 packages: - servant/ - servant-client/ @@ -6,7 +6,5 @@ packages: - servant-foreign/ - servant-server/ extra-deps: -- http-api-data-0.3 -- uri-bytestring-0.2.2.0 -- natural-transformation-0.4 +- aeson-1.1.0.0 flags: {} From 85feb31cbbdf6512bc49ee9ad7a379ca0ae84c7e Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Sun, 1 Jan 2017 20:52:18 +0200 Subject: [PATCH 2/2] Fix hspec-wai issue --- servant-server/servant-server.cabal | 2 +- servant-server/test/Servant/Server/ErrorSpec.hs | 10 ++++++++-- stack-ghc-7.8.4.yaml | 10 ++++++---- stack.yaml | 6 ++++++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/servant-server/servant-server.cabal b/servant-server/servant-server.cabal index 89b6a7f5..9179cf67 100644 --- a/servant-server/servant-server.cabal +++ b/servant-server/servant-server.cabal @@ -117,7 +117,7 @@ test-suite spec , directory , exceptions , hspec == 2.* - , hspec-wai + , hspec-wai >= 0.8 && <0.9 , http-types , network >= 2.6 , QuickCheck diff --git a/servant-server/test/Servant/Server/ErrorSpec.hs b/servant-server/test/Servant/Server/ErrorSpec.hs index 39a71721..516719d2 100644 --- a/servant-server/test/Servant/Server/ErrorSpec.hs +++ b/servant-server/test/Servant/Server/ErrorSpec.hs @@ -211,11 +211,17 @@ errorRetrySpec = it "should continue when URLs don't match" $ do request methodPost "" [jsonCT, jsonAccept] jsonBody - `shouldRespondWith` 200 { matchBody = Just $ encode (8 :: Int) } + `shouldRespondWith` 200 { matchBody = mkBody $ encode (8 :: Int) } it "should continue when methods don't match" $ do request methodGet "a" [jsonCT, jsonAccept] jsonBody - `shouldRespondWith` 200 { matchBody = Just $ encode (4 :: Int) } + `shouldRespondWith` 200 { matchBody = mkBody $ encode (4 :: Int) } + where + mkBody b = MatchBody $ \_ b' -> + if b == b' + then Nothing + else Just "body not correct\n" + -- }}} ------------------------------------------------------------------------------ diff --git a/stack-ghc-7.8.4.yaml b/stack-ghc-7.8.4.yaml index eb20cfbe..090253e5 100644 --- a/stack-ghc-7.8.4.yaml +++ b/stack-ghc-7.8.4.yaml @@ -10,10 +10,12 @@ extra-deps: - control-monad-omega-0.3.1 - cryptonite-0.6 - doctest-0.11.0 -- hspec-2.2.3 -- hspec-core-2.2.3 -- hspec-discover-2.2.3 -- hspec-expectations-0.7.2 +- hspec-2.3.2 +- hspec-discover-2.3.2 +- hspec-core-2.3.2 +- hspec-wai-0.8.0 +- hspec-expectations-0.8.2 +- call-stack-0.1.0 - http-api-data-0.3 - natural-transformation-0.4 - primitive-0.6.1.0 diff --git a/stack.yaml b/stack.yaml index 97ab4291..a45652dd 100644 --- a/stack.yaml +++ b/stack.yaml @@ -10,4 +10,10 @@ extra-deps: - http-api-data-0.3 - servant-js-0.9 # needed for tutorial - natural-transformation-0.4 +- hspec-2.3.2 +- hspec-discover-2.3.2 +- hspec-core-2.3.2 +- hspec-wai-0.8.0 +- hspec-expectations-0.8.2 +- call-stack-0.1.0 resolver: lts-6.0