yesod-test 1.4.1.1 → 1.4.2
raw patch · 3 files changed
+27/−2 lines, 3 files
Files
- ChangeLog.md +7/−1
- Yesod/Test.hs +19/−0
- yesod-test.cabal +1/−1
ChangeLog.md view
@@ -1,1 +1,7 @@-__1.4.1.1__ Upgrade to hspec 2+## 1.4.2++Provide `Example` instance for `YesodExample`.++## 1.4.1.1++Upgrade to hspec 2
Yesod/Test.hs view
@@ -2,6 +2,8 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE TypeFamilies #-} {-| Yesod.Test is a pragmatic framework for testing web applications built using wai and persistent.@@ -695,3 +697,20 @@ -- Yes, just a shortcut failure :: (MonadIO a) => T.Text -> a b failure reason = (liftIO $ HUnit.assertFailure $ T.unpack reason) >> error ""++instance YesodDispatch site => Hspec.Example (ST.StateT (YesodExampleData site) IO a) where+ type Arg (ST.StateT (YesodExampleData site) IO a) = site++ evaluateExample example params action =+ Hspec.evaluateExample+ (action $ \site -> do+ app <- toWaiAppPlain site+ _ <- ST.evalStateT example YesodExampleData+ { yedApp = app+ , yedSite = site+ , yedCookies = M.empty+ , yedResponse = Nothing+ }+ return ())+ params+ ($ ())
yesod-test.cabal view
@@ -1,5 +1,5 @@ name: yesod-test-version: 1.4.1.1+version: 1.4.2 license: MIT license-file: LICENSE author: Nubis <nubis@woobiz.com.ar>