| Stability | stable |
|---|---|
| Safe Haskell | None |
| Language | Haskell2010 |
Test.Hspec.Api.Format.V2
Contents
Description
Synopsis
- type Format = Event -> IO ()
- data FormatConfig = FormatConfig {
- formatConfigUseColor :: Bool
- formatConfigReportProgress :: Bool
- formatConfigOutputUnicode :: Bool
- formatConfigUseDiff :: Bool
- formatConfigDiffContext :: Maybe Int
- formatConfigExternalDiff :: Maybe (String -> String -> IO ())
- formatConfigPrettyPrintFunction :: Maybe (String -> String -> (String, String))
- formatConfigFormatException :: SomeException -> String
- formatConfigPrintTimes :: Bool
- formatConfigHtmlOutput :: Bool
- formatConfigPrintCpuTime :: Bool
- formatConfigUsedSeed :: Integer
- formatConfigExpectedTotalCount :: Int
- defaultFormatConfig :: FormatConfig
- data Event
- type Progress = (Int, Int)
- type Path = ([String], String)
- data Location = Location {
- locationFile :: FilePath
- locationLine :: Int
- locationColumn :: Int
- newtype Seconds = Seconds Double
- data Item = Item {
- itemLocation :: Maybe Location
- itemDuration :: Seconds
- itemInfo :: String
- itemResult :: Result
- data Result
- data FailureReason
- = NoReason
- | Reason String
- | ColorizedReason String
- | ExpectedButGot (Maybe String) String String
- | Error (Maybe String) SomeException
- monadic :: MonadIO m => (m () -> IO ()) -> (Event -> m ()) -> IO Format
- registerFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config
- useFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config
- liftFormatter :: (String, FormatConfig -> IO Format) -> (String, FormatConfig -> IO Format)
- type SpecWith a = SpecM a ()
- data Config
- modifyConfig :: (Config -> Config) -> SpecWith a
Documentation
data FormatConfig Source #
Since: 2.11.5
Constructors
| FormatConfig | |
Fields
| |
type Path = ([String], String) Source #
A Path describes the location of a spec item within a spec tree.
It consists of a list of group descriptions and a requirement description.
Since: hspec-core-2.0.0
Location is used to represent source locations.
Constructors
| Location | |
Fields
| |
Instances
| Read Location | |
Defined in Test.Hspec.Core.Example.Location | |
| Show Location | |
| Eq Location | |
Constructors
| Seconds Double |
Instances
| PrintfArg Seconds | |
Defined in Test.Hspec.Core.Clock | |
| Num Seconds | |
| Fractional Seconds | |
Defined in Test.Hspec.Core.Clock | |
| Show Seconds | |
| Eq Seconds | |
| Ord Seconds | |
Constructors
| Item | |
Fields
| |
data FailureReason Source #
Constructors
| NoReason | |
| Reason String | |
| ColorizedReason String | |
| ExpectedButGot (Maybe String) String String | |
| Error (Maybe String) SomeException |
Instances
| NFData FailureReason | |
Defined in Test.Hspec.Core.Example Methods rnf :: FailureReason -> () | |
| Show FailureReason | |
Defined in Test.Hspec.Core.Example Methods showsPrec :: Int -> FailureReason -> ShowS show :: FailureReason -> String showList :: [FailureReason] -> ShowS | |
Register a formatter
registerFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config Source #
Make a formatter available for use with --format.
useFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config Source #
Make a formatter available for use with --format and use it by default.
liftFormatter :: (String, FormatConfig -> IO Format) -> (String, FormatConfig -> IO Format) Source #
Make a formatter compatible with types from Test.Hspec.Core.Format.
Re-exports
type SpecWith a = SpecM a () Source #
A represents a test or group of tests that require an SpecWith aa
value to run.
In the common case, a Spec is a which requires SpecWith ()() 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.