@@ -157,9 +157,9 @@ spec = do
157 (Arrow.left show <$> runEitherT (getBody p host)) `shouldReturn` Right p
157 (Arrow.left show <$> runEitherT (getBody p host)) `shouldReturn` Right p
159 it "Servant.API.QueryParam" $ withServer $ \ host -> do
159 it "Servant.API.QueryParam" $ withServer $ \ host -> do
160− (Arrow.left show <$> runEitherT (getQueryParam (Just "alice") host)) `shouldReturn` Right alice
160+ Arrow.left show <$> runEitherT (getQueryParam (Just "alice") host) `shouldReturn` Right alice
161− Left (FailureResponse s _ _) <- runEitherT (getQueryParam (Just "bob") host)
161+ Left FailureResponse{..} <- runEitherT (getQueryParam (Just "bob") host)
162− statusCode s `shouldBe` 400
162+ responseStatus `shouldBe` Status 400 "bob not found"
164 it "Servant.API.QueryParam.QueryParams" $ withServer $ \ host -> do
164 it "Servant.API.QueryParam.QueryParams" $ withServer $ \ host -> do
165 (Arrow.left show <$> runEitherT (getQueryParams [] host)) `shouldReturn` Right []
165 (Arrow.left show <$> runEitherT (getQueryParams [] host)) `shouldReturn` Right []
@@ -171,22 +171,20 @@ spec = do
171 it (show flag) $ withServer $ \ host -> do
171 it (show flag) $ withServer $ \ host -> do
172 (Arrow.left show <$> runEitherT (getQueryFlag flag host)) `shouldReturn` Right flag
172 (Arrow.left show <$> runEitherT (getQueryFlag flag host)) `shouldReturn` Right flag
175 it "Servant.API.MatrixParam" $ withServer $ \ host -> do
174 it "Servant.API.MatrixParam" $ withServer $ \ host -> do
176− runEitherT (getMatrixParam (Just "alice") host) `shouldReturn` Right alice
175+ Arrow.left show <$> runEitherT (getMatrixParam (Just "alice") host) `shouldReturn` Right alice
177− Left result <- runEitherT (getMatrixParam (Just "bob") host)
176+ Left FailureResponse{..} <- runEitherT (getMatrixParam (Just "bob") host)
178− result `shouldContain` "bob not found"
177+ responseStatus `shouldBe` Status 400 "bob not found"
180 it "Servant.API.MatrixParam.MatrixParams" $ withServer $ \ host -> do
179 it "Servant.API.MatrixParam.MatrixParams" $ withServer $ \ host -> do
181− runEitherT (getMatrixParams [] host) `shouldReturn` Right []
180+ Arrow.left show <$> runEitherT (getMatrixParams [] host) `shouldReturn` Right []
182− runEitherT (getMatrixParams ["alice", "bob"] host)
181+ Arrow.left show <$> runEitherT (getMatrixParams ["alice", "bob"] host)
183 `shouldReturn` Right [Person "alice" 0, Person "bob" 1]
182 `shouldReturn` Right [Person "alice" 0, Person "bob" 1]
185 context "Servant.API.MatrixParam.MatrixFlag" $
184 context "Servant.API.MatrixParam.MatrixFlag" $
186 forM_ [False, True] $ \ flag ->
185 forM_ [False, True] $ \ flag ->
187 it (show flag) $ withServer $ \ host -> do
186 it (show flag) $ withServer $ \ host -> do
188− runEitherT (getMatrixFlag flag host) `shouldReturn` Right flag
187+ Arrow.left show <$> runEitherT (getMatrixFlag flag host) `shouldReturn` Right flag
191 it "Servant.API.Raw on success" $ withServer $ \ host -> do
189 it "Servant.API.Raw on success" $ withServer $ \ host -> do
192 (Arrow.left show <$> runEitherT (getRawSuccess methodGet host))
190 (Arrow.left show <$> runEitherT (getRawSuccess methodGet host))
@@ -214,8 +212,8 @@ spec = do
214 \ host -> do
212 \ host -> do
215 let getResponse :: BaseUrl -> EitherT ServantError IO ()
213 let getResponse :: BaseUrl -> EitherT ServantError IO ()
216 getResponse = client api
214 getResponse = client api
217− Left (FailureResponse status _ _) <- runEitherT (getResponse host)
215+ Left FailureResponse{..} <- runEitherT (getResponse host)
218− status `shouldBe` (Status 500 "error message")
216+ responseStatus `shouldBe` (Status 500 "error message")
219 mapM_ test $
217 mapM_ test $
220 (WrappedApi (Proxy :: Proxy Delete), "Delete") :
218 (WrappedApi (Proxy :: Proxy Delete), "Delete") :
221 (WrappedApi (Proxy :: Proxy (Get '[JSON] ())), "Delete") :
219 (WrappedApi (Proxy :: Proxy (Get '[JSON] ())), "Delete") :