hspec-1.3.0.2: Behavior Driven Development for Haskell

Safe HaskellNone

Test.Hspec.QuickCheck

Description

Importing this module allows you to use a QuickCheck Property as an example for a behavior. Use property to turn any Testable into a Property.

NOTE: Any output from the example to stdout is ignored. If you need to write out for debugging, you can write to stderr or a file handle.

 import Test.Hspec.Monadic
 import Test.Hspec.QuickCheck

 main :: IO ()
 main = hspec $ do
   describe "reverse" $ do
     it "gives the original list, if applied twice" $ property $
       \xs -> (reverse . reverse) xs == (xs :: [Int])

Synopsis

Documentation

property :: Testable prop => prop -> Property

prop :: Testable t => String -> t -> SpecSource

Monadic DSL shortcut, use this instead of it.