packages feed

hspec-snap 1.0.0.2 → 1.0.1.0

raw patch · 3 files changed

+42/−25 lines, 3 filesdep ~HandsomeSoupdep ~aesondep ~basenew-uploaderPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: HandsomeSoup, aeson, base, bytestring, containers, digestive-functors, hspec, hspec-core, hspec-snap, hxt, lens, mtl, snap, snap-core, text, transformers

API changes (from Hackage documentation)

- Test.Hspec.Snap: SnapHspecState :: Result -> (Handler b b ()) -> (Snaplet b) -> (InitializerState b) -> (MVar [(Text, Text)]) -> (Handler b b ()) -> (Handler b b ()) -> SnapHspecState b
+ Test.Hspec.Snap: SnapHspecState :: ResultStatus -> Handler b b () -> Snaplet b -> InitializerState b -> MVar [(Text, Text)] -> Handler b b () -> Handler b b () -> SnapHspecState b
- Test.Hspec.Snap: class Factory b a d | a -> b, a -> d, d -> a where create transform = save $ transform fields reload = return
+ Test.Hspec.Snap: class Factory b a d | a -> b, a -> d, d -> a
- Test.Hspec.Snap: setResult :: Result -> SnapHspecM b ()
+ Test.Hspec.Snap: setResult :: ResultStatus -> SnapHspecM b ()

Files

CHANGELOG view
@@ -1,3 +1,5 @@+1.0.1.0 - 2019-05-22 - Support hspec-2.2 through hspec-2.7+ 1.0.0.0 - 2016-08-06 - Upgrade to snap 1.0  0.4.0.1 - 2016-3-23 - Export RespCode.
hspec-snap.cabal view
@@ -1,5 +1,5 @@ name:                hspec-snap-version:             1.0.0.2+version:             1.0.1.0 synopsis:            A library for testing with Hspec and the Snap Web Framework homepage:            https://github.com/dbp/hspec-snap license:             BSD3@@ -18,20 +18,20 @@   exposed-modules:         Test.Hspec.Snap   hs-source-dirs:  src-  build-depends:   base                     >= 4.6      && < 4.10-                 , aeson                    >= 0.6      && < 1.3+  build-depends:   base                     >= 4.6      && < 4.13+                 , aeson                    >= 0.6      && < 1.5                  , bytestring               >= 0.9      && < 0.11-                 , containers               >= 0.4      && < 0.6+                 , containers               >= 0.4      && < 0.7                  , digestive-functors       >= 0.7      && < 0.9-                 , hspec                    >= 2.2      && < 2.5-                 , hspec-core               >= 2.2      && < 2.5+                 , hspec                    >= 2.2      && < 2.8+                 , hspec-core               >= 2.2      && < 2.8                  , HUnit                    >= 1.5      && < 1.7                  , hxt                      >= 9.3      && < 9.4                  , HandsomeSoup             >= 0.3      && < 0.5                  , lens                     >= 3.10     && < 5                  , mtl                      >= 2        && < 3-                 , snap                     >= 1.0      && < 1.1-                 , snap-core                >= 1.0      && < 1.1+                 , snap                     >= 1.0      && < 1.2+                 , snap-core                >= 1.0      && < 1.2                  , text                     >= 0.11     && < 1.3                  , transformers             >= 0.3      && < 0.6 @@ -41,20 +41,20 @@   hs-source-dirs:  spec   main-is:         Main.hs   other-modules:   Utils-  build-depends:   base                     >= 4.6      && < 4.10-                 , aeson                    >= 0.6      && < 1.3-                 , bytestring               >= 0.9      && < 0.11-                 , containers               >= 0.4      && < 0.6-                 , digestive-functors       >= 0.7      && < 0.9-                 , hspec                    >= 2.2      && < 2.5-                 , hspec-core               >= 2.2      && < 2.5-                 , hxt                      >= 9.3      && < 9.4-                 , HandsomeSoup             >= 0.3      && < 0.5-                 , lens                     >= 3.10     && < 5-                 , mtl                      >= 2        && < 3-                 , snap                     >= 1.0      && < 1.1-                 , snap-core                >= 1.0      && < 1.1-                 , text                     >= 0.11     && < 1.3-                 , transformers             >= 0.3      && < 0.6+  build-depends:   base+                 , aeson+                 , bytestring+                 , containers+                 , digestive-functors                  , directory                >= 1.2      && < 1.4-  build-depends:   hspec-snap               == 1.0.0.2+                 , hspec+                 , hspec-core+                 , hxt+                 , HandsomeSoup+                 , lens+                 , mtl+                 , snap+                 , snap-core+                 , text+                 , transformers+  build-depends:   hspec-snap
src/Test/Hspec/Snap.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP                                                           #-} {-# LANGUAGE DataKinds                                                     #-} {-# LANGUAGE FlexibleContexts                                              #-} {-# LANGUAGE FlexibleInstances                                             #-}@@ -148,7 +149,12 @@ -- > Session state -- > Before handler (runs before each eval) -- > After handler (runs after each eval).-data SnapHspecState b = SnapHspecState Result+data SnapHspecState b = SnapHspecState+#if MIN_VERSION_hspec(2,5,0)+                                       ResultStatus+#else+                                       Result+#endif                                        (Handler b b ())                                        (Snaplet b)                                        (InitializerState b)@@ -163,7 +169,12 @@     do mv <- newEmptyMVar        cb $ \st -> do ((),SnapHspecState r' _ _ _ _ _ _) <- runStateT s st                       putMVar mv r'+#if MIN_VERSION_hspec(2,5,0)+       rs <- takeMVar mv+       return $ Result "" rs+#else        takeMVar mv+#endif  -- | Factory instances allow you to easily generate test data. --@@ -338,7 +349,11 @@  -- | Records a test Success or Fail. Only the first Fail will be -- recorded (and will cause the whole block to Fail).+#if MIN_VERSION_hspec(2,5,0)+setResult :: ResultStatus -> SnapHspecM b ()+#else setResult :: Result -> SnapHspecM b ()+#endif setResult r = do (SnapHspecState r' s a i sess bef aft) <- S.get                  case r' of                    Success -> S.put (SnapHspecState r s a i sess bef aft)