/usr/share/doc/libghc-hspec-doc/html/hspec.txt is in libghc-hspec-doc 2.4.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | -- 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:
--
-- <ul>
-- <li>a friendly DSL for defining tests</li>
-- <li>integration with QuickCheck, SmallCheck, and HUnit</li>
-- <li>parallel test execution</li>
-- <li>automatic discovery of test files</li>
-- </ul>
--
-- The Hspec Manual is at <a>http://hspec.github.io/</a>.
@package hspec
@version 2.4.4
module Test.Hspec.Runner
-- | <i>Deprecated: use <a>Test.Hspec.Contrib.HUnit</a> from package
-- <tt>hspec-contrib</tt> instead</i>
module Test.Hspec.HUnit
-- | Convert a HUnit test suite to a spec. This can be used to run existing
-- HUnit tests with Hspec.
fromHUnitTest :: Test -> Spec
module Test.Hspec.Formatters
-- | <i>Warning: This module is used by <tt>hspec-discover</tt>. It is not
-- part of the public API and may change at any time.</i>
module Test.Hspec.Discover
type Spec = SpecWith ()
-- | Run given spec and write a report to <a>stdout</a>. Exit with
-- <a>exitFailure</a> if at least one spec item fails.
hspec :: Spec -> IO ()
class IsFormatter a
toFormatter :: IsFormatter a => a -> IO Formatter
hspecWithFormatter :: IsFormatter a => a -> Spec -> IO ()
postProcessSpec :: FilePath -> Spec -> Spec
-- | The <tt>describe</tt> function combines a list of specs into a larger
-- spec.
describe :: String -> SpecWith a -> SpecWith a
instance Test.Hspec.Discover.IsFormatter (GHC.Types.IO Test.Hspec.Core.Formatters.Monad.Formatter)
instance Test.Hspec.Discover.IsFormatter Test.Hspec.Core.Formatters.Monad.Formatter
-- | <i>Deprecated: use <a>Test.Hspec.Core.Spec</a> instead</i>
module Test.Hspec.Core
describe :: String -> [SpecTree a] -> SpecTree a
it :: Example a => String -> a -> SpecTree (Arg a)
-- | Hspec is a testing framework for Haskell.
--
-- This is the library reference for Hspec. The <a>User's Manual</a>
-- contains more in-depth documentation.
module Test.Hspec
type Spec = SpecWith ()
type SpecWith a = SpecM a ()
-- | A type class for examples
class Example e where type Arg e :: * where {
type family Arg e :: *;
}
-- | The <tt>it</tt> function creates a spec item.
--
-- A spec item consists of:
--
-- <ul>
-- <li>a textual description of a desired behavior</li>
-- <li>an example for that behavior</li>
-- </ul>
--
-- <pre>
-- describe "absolute" $ do
-- it "returns a positive number when given a negative number" $
-- absolute (-1) == 1
-- </pre>
it :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)
-- | <tt>specify</tt> is an alias for <a>it</a>.
specify :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)
-- | The <tt>describe</tt> function combines a list of specs into a larger
-- spec.
describe :: String -> SpecWith a -> SpecWith a
-- | <tt>context</tt> is an alias for <a>describe</a>.
context :: String -> SpecWith a -> SpecWith a
-- | <tt>example</tt> is a type restricted version of <a>id</a>. It can be
-- used to get better error messages on type mismatches.
--
-- Compare e.g.
--
-- <pre>
-- it "exposes some behavior" $ example $ do
-- putStrLn
-- </pre>
--
-- with
--
-- <pre>
-- it "exposes some behavior" $ do
-- putStrLn
-- </pre>
example :: Expectation -> Expectation
-- | <a>parallel</a> 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.
--
-- <a>SpecM</a> is a monad to construct a spec tree, without executing
-- any spec items. <tt>runIO</tt> 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 <tt>--dry-run</tt> is specified).
-- If you do not need the result of the IO action to construct the spec
-- tree, <a>beforeAll</a> may be more suitable for your use case.
runIO :: IO r -> SpecM a r
-- | <a>pending</a> can be used to mark a spec item as pending.
--
-- If you want to textually specify a behavior but do not have an example
-- yet, use this:
--
-- <pre>
-- describe "fancyFormatter" $ do
-- it "can format text in a way that everyone likes" $
-- pending
-- </pre>
pending :: Expectation
-- | <a>pendingWith</a> is similar to <a>pending</a>, but it takes an
-- additional string argument that can be used to specify the reason for
-- why the spec item is pending.
pendingWith :: String -> Expectation
-- | Changing <a>it</a> to <a>xit</a> marks the corresponding spec item as
-- pending.
--
-- This can be used to temporarily disable a spec item.
xit :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)
-- | <tt>xspecify</tt> is an alias for <a>xit</a>.
xspecify :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)
-- | Changing <a>describe</a> to <a>xdescribe</a> marks all spec items of
-- the corresponding subtree as pending.
--
-- This can be used to temporarily disable spec items.
xdescribe :: String -> SpecWith a -> SpecWith a
-- | <tt>xcontext</tt> is an alias for <a>xdescribe</a>.
xcontext :: String -> SpecWith a -> SpecWith a
-- | An <a>IO</a> action that expects an argument of type <tt>a</tt>
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 <a>stdout</a>. Exit with
-- <a>exitFailure</a> if at least one spec item fails.
hspec :: Spec -> IO ()
module Test.Hspec.QuickCheck
-- | Use a modified <a>maxSuccess</a> for given spec.
modifyMaxSuccess :: (Int -> Int) -> SpecWith a -> SpecWith a
-- | Use a modified <a>maxDiscardRatio</a> for given spec.
modifyMaxDiscardRatio :: (Int -> Int) -> SpecWith a -> SpecWith a
-- | Use a modified <a>maxSize</a> for given spec.
modifyMaxSize :: (Int -> Int) -> SpecWith a -> SpecWith a
-- | <pre>
-- prop ".." $
-- ..
-- </pre>
--
-- is a shortcut for
--
-- <pre>
-- it ".." $ property $
-- ..
-- </pre>
prop :: (HasCallStack, Testable prop) => String -> prop -> Spec
|