packages feed

hspec-wai 0.6.4 → 0.6.5

raw patch · 2 files changed

+10/−3 lines, 2 filesdep +with-location

Dependencies added: with-location

Files

hspec-wai.cabal view
@@ -1,9 +1,9 @@--- This file has been generated from package.yaml by hpack version 0.8.0.+-- This file has been generated from package.yaml by hpack version 0.10.0. -- -- see: https://github.com/sol/hpack  name:             hspec-wai-version:          0.6.4+version:          0.6.5 homepage:         https://github.com/hspec/hspec-wai#readme bug-reports:      https://github.com/hspec/hspec-wai/issues license:          MIT@@ -44,6 +44,7 @@     , hspec-core == 2.*     , hspec-expectations     , QuickCheck+    , with-location   exposed-modules:       Test.Hspec.Wai       Test.Hspec.Wai.QuickCheck@@ -51,6 +52,7 @@   other-modules:       Test.Hspec.Wai.Matcher       Test.Hspec.Wai.Util+      Paths_hspec_wai   default-language: Haskell2010  test-suite spec@@ -73,6 +75,7 @@     , hspec-core == 2.*     , hspec-expectations     , QuickCheck+    , with-location     , hspec     , QuickCheck   other-modules:
src/Test/Hspec/Wai.hs view
@@ -1,4 +1,6 @@ {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE CPP #-}+#include "with-location.h" -- | Have a look at the <https://github.com/hspec/hspec-wai#readme README> for -- an example of how to use this library. module Test.Hspec.Wai (@@ -31,6 +33,8 @@ , pendingWith ) where +with_location_imports+ import           Data.Foldable import           Data.ByteString (ByteString) import qualified Data.ByteString.Lazy as LB@@ -95,7 +99,7 @@ -- -- > get "/" `shouldRespondWith` "foo" {matchHeaders = ["Content-Type" <:> "text/plain"]} -- > -- matches if body is "foo", status is 200 and ther is a header field "Content-Type: text/plain"-shouldRespondWith :: WaiSession SResponse -> ResponseMatcher -> WaiExpectation+shouldRespondWith :: with_location WaiSession SResponse -> ResponseMatcher -> WaiExpectation shouldRespondWith action matcher = do   r <- action   forM_ (match r matcher) (liftIO . expectationFailure)