Modulehspec-core-2.11.18Haskell2010
Test.Hspec.Core.Hooks
Synopsis
- type Spec
- type SpecWith
- type ActionWith
- value before
- value before_
- value beforeWith
- value beforeAll
- value beforeAll_
- value beforeAllWith
- value after
- value after_
- value afterAll
- value afterAll_
- value around
- value around_
- value aroundWith
- value aroundAll
- value aroundAll_
- value aroundAllWith
- value mapSubject
- value ignoreSubject
- Packagehspec-core-2.11.18
- Exports21
- LanguageHaskell2010
- LicenceMIT
- SourceMonad.hs
Types
A SpecWith a represents a test or group of tests that require an a
value to run.
In the common case, a Spec is a SpecWith () which requires () and
can thus be executed with hspec.
To supply an argument to SpecWith tests to turn them into Spec, use functions from Test.Hspec.Core.Hooks such as around, before, mapSubject and similar.
Values of this type are created by it, describe and similar.
Hooks
Run a custom action before every spec item.
Run a custom action before every spec item.
Run a custom action before every spec item.
Run a custom action before the first spec item.
Run a custom action before the first spec item.
Run a custom action with an argument before the first spec item.
Run a custom action after every spec item.
Run a custom action after every spec item.
Run a custom action after the last spec item.
Run a custom action after the last spec item.
around :: (ActionWith a -> IO ())Function provided with an action to run the spec item as argument. It should return the action to actually execute the item.
-> SpecWith aSpec to modify
-> Spec
Run a custom action before and/or after every spec item, supplying it with an argument obtained via IO.
This is useful for tasks like creating a file handle or similar resource before a test and destroying it after the test.
Run a custom action before and/or after every spec item.
Run a custom action before and/or after every spec item.
Wrap an action around the given spec.
Wrap an action around the given spec.
Wrap an action around the given spec. Changes the arg type inside.
Modify the subject under test.
Note that this resembles a contravariant functor on the first type parameter of SpecM. This is because the subject is passed inwards, as an argument to the spec item.
Ignore the subject under test for a given spec.