hspec-1.1.0: Behavior Driven Development for Haskell

Safe HaskellSafe-Infered

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 = hspecX $ 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 -> SpecsSource

Monadic DSL shortcut, use this instead of it.