hspec-1.2.0: Behavior Driven Development for Haskell

Safe HaskellSafe-Infered



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])



property :: Testable prop => prop -> Property

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

Monadic DSL shortcut, use this instead of it.