This file is indexed.

/usr/share/doc/libghc-hspec-doc/html/Test-Hspec.html is in libghc-hspec-doc 2.2.1-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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Test.Hspec</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Test-Hspec.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Test-Hspec.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">hspec-2.2.1: A Testing Framework for Haskell</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Stability</th><td>stable</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Test.Hspec</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Types</a></li><li><a href="#g:2">Setting expectations</a></li><li><a href="#g:3">Defining a spec</a></li><li><a href="#g:4">Hooks</a></li><li><a href="#g:5">Running a spec</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Hspec is a testing framework for Haskell.</p><p>This is the library reference for Hspec.
 The <a href="http://hspec.github.io/">User's Manual</a> contains more in-depth
 documentation.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">type</span> <a href="#t:Spec">Spec</a> = <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> ()</li><li class="src short"><span class="keyword">type</span> <a href="#t:SpecWith">SpecWith</a> a = <a href="file:///usr/share/doc/libghc-hspec-core-doc/html/Test-Hspec-Core-Spec.html#t:SpecM">SpecM</a> a ()</li><li class="src short"><span class="keyword">type family</span> <a href="#t:Arg">Arg</a> e :: *</li><li class="src short"><span class="keyword">class</span> <a href="#t:Example">Example</a> e <span class="keyword">where</span><ul class="subs"><li><span class="keyword">type</span> <a href="#t:Arg">Arg</a> e :: *</li></ul></li><li class="src short">module <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html">Test.Hspec.Expectations</a></li><li class="src short"><a href="#v:describe">describe</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</li><li class="src short"><a href="#v:context">context</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</li><li class="src short"><a href="#v:it">it</a> :: (?loc :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Stack.html#t:CallStack">CallStack</a>, <a href="Test-Hspec.html#t:Example">Example</a> a) =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> (<a href="Test-Hspec.html#t:Arg">Arg</a> a)</li><li class="src short"><a href="#v:specify">specify</a> :: <a href="Test-Hspec.html#t:Example">Example</a> a =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> (<a href="Test-Hspec.html#t:Arg">Arg</a> a)</li><li class="src short"><a href="#v:example">example</a> :: <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a> -&gt; <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a></li><li class="src short"><a href="#v:pending">pending</a> :: <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a></li><li class="src short"><a href="#v:pendingWith">pendingWith</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a></li><li class="src short"><a href="#v:parallel">parallel</a> :: <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</li><li class="src short"><a href="#v:runIO">runIO</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> r -&gt; <a href="file:///usr/share/doc/libghc-hspec-core-doc/html/Test-Hspec-Core-Spec.html#t:SpecM">SpecM</a> a r</li><li class="src short"><span class="keyword">type</span> <a href="#t:ActionWith">ActionWith</a> a = a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:before">before</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:Spec">Spec</a></li><li class="src short"><a href="#v:before_">before_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</li><li class="src short"><a href="#v:beforeWith">beforeWith</a> :: (b -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> b</li><li class="src short"><a href="#v:beforeAll">beforeAll</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:Spec">Spec</a></li><li class="src short"><a href="#v:beforeAll_">beforeAll_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</li><li class="src short"><a href="#v:after">after</a> :: <a href="Test-Hspec.html#t:ActionWith">ActionWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</li><li class="src short"><a href="#v:after_">after_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</li><li class="src short"><a href="#v:afterAll">afterAll</a> :: <a href="Test-Hspec.html#t:ActionWith">ActionWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</li><li class="src short"><a href="#v:afterAll_">afterAll_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</li><li class="src short"><a href="#v:around">around</a> :: (<a href="Test-Hspec.html#t:ActionWith">ActionWith</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()) -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:Spec">Spec</a></li><li class="src short"><a href="#v:around_">around_</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()) -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</li><li class="src short"><a href="#v:aroundWith">aroundWith</a> :: (<a href="Test-Hspec.html#t:ActionWith">ActionWith</a> a -&gt; <a href="Test-Hspec.html#t:ActionWith">ActionWith</a> b) -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> b</li><li class="src short"><a href="#v:hspec">hspec</a> :: <a href="Test-Hspec.html#t:Spec">Spec</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li></ul></div><div id="interface"><h1 id="g:1">Types</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Spec" class="def">Spec</a> = <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> ()</p></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:SpecWith" class="def">SpecWith</a> a = <a href="file:///usr/share/doc/libghc-hspec-core-doc/html/Test-Hspec-Core-Spec.html#t:SpecM">SpecM</a> a ()</p></div><div class="top"><p class="src"><span class="keyword">type family</span> <a name="t:Arg" class="def">Arg</a> e :: *</p><div class="subs instances"><p id="control.i:Arg" class="caption collapser" onclick="toggleSection('i:Arg')">Instances</p><div id="section.i:Arg" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Test-Hspec.html#t:Arg">Arg</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> = ()</span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Test-Hspec.html#t:Arg">Arg</a> <a href="file:///usr/share/doc/libghc-quickcheck2-doc/html/Test-QuickCheck-Property.html#t:Property">Property</a> = ()</span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Test-Hspec.html#t:Arg">Arg</a> <a href="file:///usr/share/doc/libghc-hspec-core-doc/html/Test-Hspec-Core-Spec.html#t:Result">Result</a> = ()</span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Test-Hspec.html#t:Arg">Arg</a> <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a> = ()</span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Test-Hspec.html#t:Arg">Arg</a> (a -&gt; <a href="file:///usr/share/doc/libghc-quickcheck2-doc/html/Test-QuickCheck-Property.html#t:Property">Property</a>) = a</span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Test-Hspec.html#t:Arg">Arg</a> (a -&gt; <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a>) = a</span></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:Example" class="def">Example</a> e</p><div class="doc"><p>A type class for examples</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="file:///usr/share/doc/libghc-hspec-core-doc/html/Test-Hspec-Core-Spec.html#v:evaluateExample">evaluateExample</a></p></div><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a name="t:Arg" class="def">Arg</a> e :: *</p></div><div class="subs instances"><p id="control.i:Example" class="caption collapser" onclick="toggleSection('i:Example')">Instances</p><div id="section.i:Example" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="Test-Hspec.html#t:Example">Example</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Test-Hspec.html#t:Example">Example</a> <a href="file:///usr/share/doc/libghc-quickcheck2-doc/html/Test-QuickCheck-Property.html#t:Property">Property</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Test-Hspec.html#t:Example">Example</a> <a href="file:///usr/share/doc/libghc-hspec-core-doc/html/Test-Hspec-Core-Spec.html#t:Result">Result</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Test-Hspec.html#t:Example">Example</a> <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Test-Hspec.html#t:Example">Example</a> (a -&gt; <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a>)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Test-Hspec.html#t:Example">Example</a> (a -&gt; <a href="file:///usr/share/doc/libghc-quickcheck2-doc/html/Test-QuickCheck-Property.html#t:Property">Property</a>)</span></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><h1 id="g:2">Setting expectations</h1><div class="top"><p class="src">module <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html">Test.Hspec.Expectations</a></p></div><h1 id="g:3">Defining a spec</h1><div class="top"><p class="src"><a name="v:describe" class="def">describe</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</p><div class="doc"><p>The <code>describe</code> function combines a list of specs into a larger spec.</p></div></div><div class="top"><p class="src"><a name="v:context" class="def">context</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a <a href="src/Test-Hspec.html#context" class="link">Source</a></p><div class="doc"><p><code>context</code> is an alias for <code><a href="Test-Hspec.html#v:describe">describe</a></code>.</p></div></div><div class="top"><p class="src"><a name="v:it" class="def">it</a> :: (?loc :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Stack.html#t:CallStack">CallStack</a>, <a href="Test-Hspec.html#t:Example">Example</a> a) =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> (<a href="Test-Hspec.html#t:Arg">Arg</a> a)</p><div class="doc"><p>The <code>it</code> function creates a spec item.</p><p>A spec item consists of:</p><ul><li>a textual description of a desired behavior</li><li>an example for that behavior</li></ul><pre>describe &quot;absolute&quot; $ do
  it &quot;returns a positive number when given a negative number&quot; $
    absolute (-1) == 1</pre></div></div><div class="top"><p class="src"><a name="v:specify" class="def">specify</a> :: <a href="Test-Hspec.html#t:Example">Example</a> a =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> (<a href="Test-Hspec.html#t:Arg">Arg</a> a) <a href="src/Test-Hspec.html#specify" class="link">Source</a></p><div class="doc"><p><code>specify</code> is an alias for <code><a href="Test-Hspec.html#v:it">it</a></code>.</p></div></div><div class="top"><p class="src"><a name="v:example" class="def">example</a> :: <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a> -&gt; <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a> <a href="src/Test-Hspec.html#example" class="link">Source</a></p><div class="doc"><p><code>example</code> is a type restricted version of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Function.html#v:id">id</a></code>.  It can be used to get better
 error messages on type mismatches.</p><p>Compare e.g.</p><pre>it &quot;exposes some behavior&quot; $ example $ do
  putStrLn</pre><p>with</p><pre>it &quot;exposes some behavior&quot; $ do
  putStrLn</pre></div></div><div class="top"><p class="src"><a name="v:pending" class="def">pending</a> :: <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a></p><div class="doc"><p><code><a href="Test-Hspec.html#v:pending">pending</a></code> can be used to indicate that an example is <em>pending</em>.</p><p>If you want to textually specify a behavior but do not have an example yet,
 use this:</p><pre>describe &quot;fancyFormatter&quot; $ do
  it &quot;can format text in a way that everyone likes&quot; $
    pending</pre></div></div><div class="top"><p class="src"><a name="v:pendingWith" class="def">pendingWith</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/libghc-hspec-expectations-doc/html/Test-Hspec-Expectations.html#t:Expectation">Expectation</a></p><div class="doc"><p><code><a href="Test-Hspec.html#v:pendingWith">pendingWith</a></code> is similar to <code><a href="Test-Hspec.html#v:pending">pending</a></code>, but it takes an additional string
 argument that can be used to specify the reason for why it's pending.</p></div></div><div class="top"><p class="src"><a name="v:parallel" class="def">parallel</a> :: <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</p><div class="doc"><p><code><a href="Test-Hspec.html#v:parallel">parallel</a></code> marks all spec items of the given spec to be safe for parallel
 evaluation.</p></div></div><div class="top"><p class="src"><a name="v:runIO" class="def">runIO</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> r -&gt; <a href="file:///usr/share/doc/libghc-hspec-core-doc/html/Test-Hspec-Core-Spec.html#t:SpecM">SpecM</a> a r</p><div class="doc"><p>Run an IO action while constructing the spec tree.</p><p><code><a href="file:///usr/share/doc/libghc-hspec-core-doc/html/Test-Hspec-Core-Spec.html#t:SpecM">SpecM</a></code> is a monad to construct a spec tree, without executing any spec
 items.  <code>runIO</code> 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 <code>--dry-run</code> is specified).
 If you do not need the result of the IO action to construct the spec tree,
 <code><a href="file:///usr/share/doc/libghc-hspec-core-doc/html/Test-Hspec-Core-Hooks.html#v:beforeAll">beforeAll</a></code> may be more suitable for your use case.</p></div></div><h1 id="g:4">Hooks</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:ActionWith" class="def">ActionWith</a> a = a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>An <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a></code> action that expects an argument of type <code>a</code></p></div></div><div class="top"><p class="src"><a name="v:before" class="def">before</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:Spec">Spec</a></p><div class="doc"><p>Run a custom action before every spec item.</p></div></div><div class="top"><p class="src"><a name="v:before_" class="def">before_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</p><div class="doc"><p>Run a custom action before every spec item.</p></div></div><div class="top"><p class="src"><a name="v:beforeWith" class="def">beforeWith</a> :: (b -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> b</p><div class="doc"><p>Run a custom action before every spec item.</p></div></div><div class="top"><p class="src"><a name="v:beforeAll" class="def">beforeAll</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:Spec">Spec</a></p><div class="doc"><p>Run a custom action before the first spec item.</p></div></div><div class="top"><p class="src"><a name="v:beforeAll_" class="def">beforeAll_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</p><div class="doc"><p>Run a custom action before the first spec item.</p></div></div><div class="top"><p class="src"><a name="v:after" class="def">after</a> :: <a href="Test-Hspec.html#t:ActionWith">ActionWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</p><div class="doc"><p>Run a custom action after every spec item.</p></div></div><div class="top"><p class="src"><a name="v:after_" class="def">after_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</p><div class="doc"><p>Run a custom action after every spec item.</p></div></div><div class="top"><p class="src"><a name="v:afterAll" class="def">afterAll</a> :: <a href="Test-Hspec.html#t:ActionWith">ActionWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</p><div class="doc"><p>Run a custom action after the last spec item.</p></div></div><div class="top"><p class="src"><a name="v:afterAll_" class="def">afterAll_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</p><div class="doc"><p>Run a custom action after the last spec item.</p></div></div><div class="top"><p class="src"><a name="v:around" class="def">around</a> :: (<a href="Test-Hspec.html#t:ActionWith">ActionWith</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()) -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:Spec">Spec</a></p><div class="doc"><p>Run a custom action before and/or after every spec item.</p></div></div><div class="top"><p class="src"><a name="v:around_" class="def">around_</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()) -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a</p><div class="doc"><p>Run a custom action before and/or after every spec item.</p></div></div><div class="top"><p class="src"><a name="v:aroundWith" class="def">aroundWith</a> :: (<a href="Test-Hspec.html#t:ActionWith">ActionWith</a> a -&gt; <a href="Test-Hspec.html#t:ActionWith">ActionWith</a> b) -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> a -&gt; <a href="Test-Hspec.html#t:SpecWith">SpecWith</a> b</p><div class="doc"><p>Run a custom action before and/or after every spec item.</p></div></div><h1 id="g:5">Running a spec</h1><div class="top"><p class="src"><a name="v:hspec" class="def">hspec</a> :: <a href="Test-Hspec.html#t:Spec">Spec</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Run given spec and write a report to <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-IO-Handle-FD.html#v:stdout">stdout</a></code>.
 Exit with <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-Exit.html#v:exitFailure">exitFailure</a></code> if at least one spec item fails.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>