packages feed

hspec-wai 0.5.1 → 0.6.0

raw patch · 3 files changed

+20/−13 lines, 3 filesdep +hspecdep +hspec-coredep +hspec-expectationsdep −hspec2

Dependencies added: hspec, hspec-core, hspec-expectations

Dependencies removed: hspec2

Files

hspec-wai.cabal view
@@ -1,5 +1,5 @@ name:             hspec-wai-version:          0.5.1+version:          0.6.0 license:          MIT license-file:     LICENSE copyright:        (c) 2012-2014 Fujimura Daisuke,@@ -36,7 +36,8 @@     , http-types     , wai >= 3     , wai-extra >= 3-    , hspec2+    , hspec-core == 2.*+    , hspec-expectations  test-suite spec   type:@@ -56,4 +57,7 @@     , http-types     , wai     , wai-extra-    , hspec2+    , hspec-core+    , hspec-expectations++    , hspec
src/Test/Hspec/Wai.hs view
@@ -23,8 +23,8 @@ -- * Helpers and re-exports , liftIO , with-, Test.Hspec.Wai.pending-, Test.Hspec.Wai.pendingWith+, pending+, pendingWith ) where  import           Data.Foldable@@ -35,8 +35,12 @@ import           Network.HTTP.Types import           Network.Wai.Test hiding (request) import qualified Network.Wai.Test as Wai-import           Test.Hspec +import           Test.Hspec.Core.Spec hiding (pending, pendingWith)+import qualified Test.Hspec.Core.Spec as Core+import           Test.Hspec.Core.Hooks+import           Test.Hspec.Expectations (expectationFailure)+ import           Test.Hspec.Wai.Internal import           Test.Hspec.Wai.Matcher @@ -44,13 +48,13 @@ with :: IO a -> SpecWith a -> Spec with = before --- | A lifted version of `Test.Hspec.pending`.+-- | A lifted version of `Core.pending`. pending :: WaiSession ()-pending = liftIO Test.Hspec.pending+pending = liftIO Core.pending --- | A lifted version of `Test.Hspec.pendingWith`.+-- | A lifted version of `Core.pendingWith`. pendingWith :: String -> WaiSession ()-pendingWith = liftIO . Test.Hspec.pendingWith+pendingWith = liftIO . Core.pendingWith  -- | Set the expectation that a response matches a specified `ResponseMatcher`. --@@ -84,7 +88,7 @@ -- If you want to require a specific header field you can specify -- `matchHeaders`: ----- > get "/" `shouldRespondWith` "foo" {matchHeaders = "Content-Type: text/plain"}+-- > 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 action matcher = do
src/Test/Hspec/Wai/Internal.hs view
@@ -15,8 +15,7 @@ import           Control.Monad.Trans.Reader import           Network.Wai (Application) import           Network.Wai.Test hiding (request)-import           Test.Hspec-import           Test.Hspec.Core (Example (..))+import           Test.Hspec.Core.Spec import           Test.Hspec.Wai.Util (formatHeader)  -- | An expectation in the `WaiSession` monad.  Failing expectations are