-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
instance Example (a -> TestT IO ()) where
type Arg (a -> TestT IO ()) = Gen a
evaluateExample example =
evaluateExample (\gen ->
a <- forAll gen
test (example a)This puts the Gen into the hspec hooks.
beforeGen :: Gen a -> SpecWith (Gen a) -> Spec
beforeGen gen = beforeAll (pure gen)
beforeWithGen :: (a -> Gen b) -> SpecWith (Gen b) -> SpecWith (Gen a)
beforeWithGen mkGen =
beforeAllWith $ \genA -> pure (genA >>= mkGen) But it also forbids you from providing "normal" values in to TestT. That's probably fine. After all you can always do pure :: a -> Gen a.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels