-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A Testing Framework for Haskell -- -- Hspec is a testing framework for Haskell. It is inspired by the Ruby -- library RSpec. Some of Hspec's distinctive features are: -- --
-- describe "absolute" $ do -- it "returns a positive number when given a negative number" $ -- absolute (-1) == 1 --it :: (?loc :: CallStack, Example a) => String -> a -> SpecWith (Arg a) -- | specify is an alias for it. specify :: Example a => String -> a -> SpecWith (Arg a) -- | example is a type restricted version of id. It can be -- used to get better error messages on type mismatches. -- -- Compare e.g. -- --
-- it "exposes some behavior" $ example $ do -- putStrLn ---- -- with -- --
-- it "exposes some behavior" $ do -- putStrLn --example :: Expectation -> Expectation -- | pending can be used to indicate that an example is -- pending. -- -- If you want to textually specify a behavior but do not have an example -- yet, use this: -- --
-- describe "fancyFormatter" $ do -- it "can format text in a way that everyone likes" $ -- pending --pending :: Expectation -- | pendingWith is similar to pending, but it takes an -- additional string argument that can be used to specify the reason for -- why it's pending. pendingWith :: String -> Expectation -- | parallel marks all spec items of the given spec to be safe for -- parallel evaluation. parallel :: SpecWith a -> SpecWith a -- | Run an IO action while constructing the spec tree. -- -- SpecM is a monad to construct a spec tree, without executing -- any spec items. runIO allows you to run IO actions during -- this construction phase. The IO action is always run when the spec -- tree is constructed (e.g. even when --dry-run is specified). -- If you do not need the result of the IO action to construct the spec -- tree, beforeAll may be more suitable for your use case. runIO :: IO r -> SpecM a r -- | An IO action that expects an argument of type a type ActionWith a = a -> IO () -- | Run a custom action before every spec item. before :: IO a -> SpecWith a -> Spec -- | Run a custom action before every spec item. before_ :: IO () -> SpecWith a -> SpecWith a -- | Run a custom action before every spec item. beforeWith :: (b -> IO a) -> SpecWith a -> SpecWith b -- | Run a custom action before the first spec item. beforeAll :: IO a -> SpecWith a -> Spec -- | Run a custom action before the first spec item. beforeAll_ :: IO () -> SpecWith a -> SpecWith a -- | Run a custom action after every spec item. after :: ActionWith a -> SpecWith a -> SpecWith a -- | Run a custom action after every spec item. after_ :: IO () -> SpecWith a -> SpecWith a -- | Run a custom action after the last spec item. afterAll :: ActionWith a -> SpecWith a -> SpecWith a -- | Run a custom action after the last spec item. afterAll_ :: IO () -> SpecWith a -> SpecWith a -- | Run a custom action before and/or after every spec item. around :: (ActionWith a -> IO ()) -> SpecWith a -> Spec -- | Run a custom action before and/or after every spec item. around_ :: (IO () -> IO ()) -> SpecWith a -> SpecWith a -- | Run a custom action before and/or after every spec item. aroundWith :: (ActionWith a -> ActionWith b) -> SpecWith a -> SpecWith b -- | Run given spec and write a report to stdout. Exit with -- exitFailure if at least one spec item fails. hspec :: Spec -> IO () module Test.Hspec.QuickCheck -- | Use a modified maxSuccess for given spec. modifyMaxSuccess :: (Int -> Int) -> SpecWith a -> SpecWith a -- | Use a modified maxDiscardRatio for given spec. modifyMaxDiscardRatio :: (Int -> Int) -> SpecWith a -> SpecWith a -- | Use a modified maxSize for given spec. modifyMaxSize :: (Int -> Int) -> SpecWith a -> SpecWith a -- |
-- prop ".." $ -- .. ---- -- is a shortcut for -- --
-- it ".." $ property $ -- .. --prop :: (?loc :: CallStack, Testable prop) => String -> prop -> Spec