eventsource-store-specs 1.0.0 → 1.0.1
raw patch · 5 files changed
+49/−13 lines, 5 filesdep ~protoludePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: protolude
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−7
- eventsource-store-specs.cabal +3/−3
- library/Test/EventSource/Store/Specification.hs +39/−0
- package.yaml +2/−2
- stack.yaml +2/−1
CHANGELOG.md view
@@ -1,7 +1,3 @@-# Change log--store-specs uses [Semantic Versioning][].-The change log is available through the [releases on GitHub][].--[Semantic Versioning]: http://semver.org/spec/v2.0.0.html-[releases on GitHub]: https://github.com/githubuser/store-specs/releases+1.0.1+=====+ * Fix Stackage build.
eventsource-store-specs.cabal view
@@ -1,9 +1,9 @@--- This file has been generated from package.yaml by hpack version 0.15.0.+-- This file has been generated from package.yaml by hpack version 0.17.1. -- -- see: https://github.com/sol/hpack name: eventsource-store-specs-version: 1.0.0+version: 1.0.1 synopsis: Provides common test specification for Store implementation. description: Provides common test specification for Store implementation. category: Eventsourcing, Testing@@ -34,7 +34,7 @@ ghc-options: -Wall build-depends: base >=4.9 && <5- , protolude >= 0.1.10 && <0.2+ , protolude >= 0.1.10 && <0.3 , eventsource-api ==1.* , tasty , tasty-hspec
library/Test/EventSource/Store/Specification.hs view
@@ -127,6 +127,45 @@ st `shouldBe` (10 :: Int) + specify "API - forSavedEvents" $ do+ let events = fmap TestEvent [0..9]+ name <- freshStreamName+ _ <- wait =<< appendEvents store name AnyVersion events++ let action = do+ forSavedEvents store name $ \(_ :: SavedEvent) -> modify incr+ get++ res <- runExceptT $ mapExceptT (\m -> evalStateT m 0) action++ res `shouldSatisfy` either (const False) (const True)+ let Right st = res++ st `shouldBe` (10 :: Int)++ specify "API - foldSavedEvents" $ do+ let values = [0..9]+ events = fmap TestEvent values+ seed = Right (0, EventNumber 0)+ + testFold (Left e) _ = Left e+ testFold (Right (a, n)) saved =+ let n' = eventNumber saved+ ee = decodeEvent $ savedEvent saved in+ case ee of+ Left t -> Left t+ Right (TestEvent a') -> Right (a + a', max n n')+ + name <- freshStreamName+ _ <- wait =<< appendEvents store name AnyVersion events++ res <- runExceptT $ foldSavedEvents store name testFold seed++ res `shouldSatisfy` either (const False) (const True)+ let Right st = res++ st `shouldBe` Right (sum values, EventNumber 9)+ specify "API - Iterator.readAllEvents" $ do let events = fmap TestEvent [0..9] name <- freshStreamName
package.yaml view
@@ -16,7 +16,7 @@ - NoImplicitPrelude dependencies: - base >=4.9 && <5- - protolude >= 0.1.10 && <0.2+ - protolude >= 0.1.10 && <0.3 - eventsource-api ==1.* - tasty - tasty-hspec@@ -30,4 +30,4 @@ maintainer: yo.eight@gmail.com name: eventsource-store-specs synopsis: Provides common test specification for Store implementation.-version: '1.0.0'+version: '1.0.1'
stack.yaml view
@@ -15,7 +15,8 @@ # resolver: # name: custom-snapshot # location: "./custom-snapshot.yaml"-resolver: lts-7.14+resolver: nightly-2017-08-15+compiler: ghc-8.2.1 # User packages to be built. # Various formats can be used as shown in the example below.