ModuleImpSpec-0.2.0.0Haskell2010
Test.ImpSpec
- 7 types
- 1 class
- 31 values
- PackageImpSpec-0.2.0.0
- Exports41
- LanguageHaskell2010
- LicenceApache-2.0
- SourceInternal.hs
Annotation for when failure happens. All the logging done within annotation will be discarded if there no failures within the annotation.
Override the QuickCheck generator using a fixed seed.
Adds a Doc to the log, which is only shown if the test fails
Adds a String to the log, which is only shown if the test fails
Adds a Text to the log, which is only shown if the test fails
Adds a source location and Doc to the log, which are only shown if the test fails
The describe function combines a list of specs into a larger spec.
fdescribe is an alias for fmap focus . describe
fit is an alias for fmap focus . it
The it function creates a spec item.
A spec item consists of:
a textual description of a desired behavior
an example for that behavior
describe "absolute" $ do
it "returns a positive number when given a negative number" $
absolute (-1) == 1Example a optionally accepts an argument Arg a, which is then given
to the test body. This is useful for provisioning resources for a test which
are created and cleaned up outside the test itself. See Arg for details.
Note that this function is often on the scene of nasty type errors due to GHC failing
to infer the type of do notation in the test body.
It can be helpful to use
TypeApplications
to explicitly specify the intended Example type.
Constructors
ImpEnvimpEnvSpecEnv :: !ImpSpecEnv timpEnvStateRef :: !IORef (ImpState t)impEnvQCGenRef :: !IOGenM QCGenimpEnvQCSize :: !Int
Stores extra information about the failure of the unit test
Constructors
ImpExceptionieAnnotation :: [Doc AnsiStyle]Description of the IO action that caused the failure
ieThrownException :: SomeExceptionException that caused the test to fail
Instances2Show, Exception
Show ImpExceptionDefined in ImpSpec-0.2.0.0 · Test.ImpSpec.InternalException ImpExceptionDefined in ImpSpec-0.2.0.0 · Test.ImpSpec.Internal
Constructors
Instances3Eq, Ord, Show
(Eq (ImpSpecEnv t), Eq (ImpSpecState t)) => Eq (ImpInit t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.Internal(Ord (ImpSpecEnv t), Ord (ImpSpecState t)) => Ord (ImpInit t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.Internal(Show (ImpSpecEnv t), Show (ImpSpecState t)) => Show (ImpInit t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.Internal
Instances15MonadReader, MonadState, Monad, Functor, MonadFail, Applicative, …
env ~ ImpSpecEnv t => MonadReader env (ImpM t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.Internals ~ ImpSpecState t => MonadState s (ImpM t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.InternalMonad (ImpM t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.InternalFunctor (ImpM t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.InternalMonadFail (ImpM t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.InternalApplicative (ImpM t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.InternalMonadIO (ImpM t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.InternalMonadGen (ImpM t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.InternalMonadUnliftIO (ImpM t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.InternalHasStatefulGen (IOGenM QCGen) (ImpM t)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.Internal(ImpSpec t, Testable a) => Testable (ImpM t a)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.Internal(ImpSpec t, Testable p) => Example (ImpM t p)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.Internal(Arbitrary a, Show a, ImpSpec t, Testable p) => Example (a -> ImpM t p)Defined in ImpSpec-0.2.0.0 · Test.ImpSpec.Internaltype Arg (ImpM t p) = ImpInit tDefined in ImpSpec-0.2.0.0 · Test.ImpSpec.Internaltype Arg (a -> ImpM t p) = ImpInit tDefined in ImpSpec-0.2.0.0 · Test.ImpSpec.Internal
Associated types
type family ImpSpecEnv ttype family ImpSpecState t
Constructors
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.