yesod-test-json 0.1.0.0 → 0.2.0.0
raw patch · 2 files changed
+8/−7 lines, 2 filesdep ~aesondep ~conduitdep ~hspec
Dependency ranges changed: aeson, conduit, hspec, http-types, wai, wai-test, yesod-default
Files
- Yesod/Test/Json.hs +6/−5
- yesod-test-json.cabal +2/−2
Yesod/Test/Json.hs view
@@ -10,7 +10,8 @@ Session(..), H.Assertion, module Test.Hspec,- module Data.Aeson+ module Data.Aeson,+ SResponse(..) ) where import qualified Test.HUnit as H import qualified Data.ByteString.Lazy.Char8 as L8@@ -28,9 +29,9 @@ -- | A request to your server. type APIFunction = ByteString -- ^ method- -> [Text] -- ^ path- -> Value -- JSON data- -> Session SResponse+ -> [Text] -- ^ path+ -> Maybe Value -- JSON data+ -> Session SResponse -- Assert a boolean value assertBool :: String -> Bool -> Session ()@@ -63,7 +64,7 @@ -- | Make a request to your server apiRequest :: AppConfig env extra -> APIFunction-apiRequest conf m p x = srequest $ SRequest r (encode x) where+apiRequest conf m p x = srequest $ SRequest r (maybe L.empty encode x) where r = defaultRequest { serverPort = appPort conf, requestBody = sourceList . L.toChunks $ encode x,
yesod-test-json.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: yesod-test-json-version: 0.1.0.0+version: 0.2.0.0 synopsis: Utility functions for testing JSON web services written in Yesod description: yesod-test-json provides combinators for using the hspec and wai-test libraries together. It is meant to be used like yesod-test, but for web services as opposed to web applications.@@ -22,4 +22,4 @@ library exposed-modules: Yesod.Test.Json -- other-modules: - build-depends: base ==4.5.*, HUnit ==1.2.*, bytestring ==0.9.*, text ==0.11.*, aeson ==0.6.*, http-types ==0.6.*, hspec ==1.3.*, wai ==1.2.*, wai-test ==1.2.*, transformers ==0.3.*, yesod-default ==1.0.*, conduit ==0.4.*+ build-depends: base ==4.5.*, HUnit ==1.2.*, bytestring ==0.9.*, text ==0.11.*, aeson, http-types, hspec, wai, wai-test, transformers ==0.3.*, yesod-default, conduit