packages feed

hspec-api 2.8.0 → 2.9.0

raw patch · 4 files changed

+57/−21 lines, 4 filesdep ~hspec-corePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: hspec-core

API changes (from Hackage documentation)

+ Test.Hspec.Api.Format.V1: [formatConfigDiffContext] :: FormatConfig -> Maybe Int
+ Test.Hspec.Api.Format.V1: [formatConfigExternalDiff] :: FormatConfig -> Maybe (String -> String -> IO ())
+ Test.Hspec.Api.Format.V1: [formatConfigOutputUnicode] :: FormatConfig -> Bool
+ Test.Hspec.Api.Format.V1: [formatConfigPrettyPrintFunction] :: FormatConfig -> Maybe (String -> String -> (String, String))
+ Test.Hspec.Api.Format.V1: [formatConfigPrettyPrint] :: FormatConfig -> Bool
+ Test.Hspec.Api.Format.V1: [formatConfigReportProgress] :: FormatConfig -> Bool
+ Test.Hspec.Api.Format.V1: registerFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config
+ Test.Hspec.Api.Formatters.V2: getExpectedTotalCount :: FormatM Int
+ Test.Hspec.Api.Formatters.V2: outputUnicode :: FormatM Bool
+ Test.Hspec.Api.Formatters.V2: registerFormatter :: (String, Formatter) -> Config -> Config
- Test.Hspec.Api.Format.V1: FormatConfig :: Bool -> Bool -> Bool -> Bool -> Bool -> Integer -> Int -> FormatConfig
+ Test.Hspec.Api.Format.V1: FormatConfig :: Bool -> Bool -> Bool -> Bool -> Maybe Int -> Maybe (String -> String -> IO ()) -> Bool -> Maybe (String -> String -> (String, String)) -> Bool -> Bool -> Bool -> Integer -> Int -> FormatConfig

Files

hspec-api.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           hspec-api-version:        2.8.0+version:        2.9.0 synopsis:       A Testing Framework for Haskell description:    This package provides a stable API that can be used to extend Hspec's functionality. category:       Testing@@ -35,7 +35,7 @@   ghc-options: -Wall   build-depends:       base ==4.*-    , hspec-core >=2.8.0 && <2.11+    , hspec-core >=2.9.0 && <2.11   default-language: Haskell2010  test-suite spec@@ -55,5 +55,5 @@       base ==4.*     , hspec ==2.*     , hspec-api-    , hspec-core >=2.8.0 && <2.11+    , hspec-core >=2.9.0 && <2.11   default-language: Haskell2010
src/Test/Hspec/Api/Format/V1.hs view
@@ -16,6 +16,7 @@ , monadic  -- * Register a formatter+, registerFormatter , useFormatter , liftFormatter @@ -23,22 +24,23 @@ , Config ) where -import           Test.Hspec.Core.Runner+import           Test.Hspec.Core.Runner (Config(..)) import           Test.Hspec.Core.Format hiding (FormatConfig(..)) import qualified Test.Hspec.Core.Format as Latest  -- |+-- Make a formatter available for use with @--format@.+registerFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config+registerFormatter = registerFormatter_ . liftFormatter++-- | -- Make a formatter available for use with @--format@ and use it by default. useFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config useFormatter (liftFormatter -> formatter@(_, format)) config = (registerFormatter_ formatter config) { configFormat = Just format }  -- copy of Test.Hspec.Core.Runner.registerFormatter registerFormatter_ :: (String, Latest.FormatConfig -> IO Latest.Format) -> Config -> Config-#if MIN_VERSION_hspec_core(2,9,0) registerFormatter_ formatter config = config { configAvailableFormatters = formatter : configAvailableFormatters config }-#else-registerFormatter_ _ config = config-#endif  -- | Make a formatter compatible with types from "Test.Hspec.Core.Format". liftFormatter :: (String, FormatConfig -> IO Format) -> (String, Latest.FormatConfig -> IO Format)@@ -49,7 +51,13 @@  data FormatConfig = FormatConfig {   formatConfigUseColor :: Bool+, formatConfigReportProgress :: Bool+, formatConfigOutputUnicode :: Bool , formatConfigUseDiff :: Bool+, formatConfigDiffContext :: Maybe Int+, formatConfigExternalDiff :: Maybe (String -> String -> IO ())+, formatConfigPrettyPrint :: Bool -- ^ Deprecated: use `formatConfigPrettyPrintFunction` instead+, formatConfigPrettyPrintFunction :: Maybe (String -> String -> (String, String)) , formatConfigPrintTimes :: Bool , formatConfigHtmlOutput :: Bool , formatConfigPrintCpuTime :: Bool@@ -60,14 +68,41 @@ liftFormatConfig :: Latest.FormatConfig -> FormatConfig liftFormatConfig config = FormatConfig {   formatConfigUseColor = Latest.formatConfigUseColor config++#if MIN_VERSION_hspec_core(2,9,5)+, formatConfigReportProgress = Latest.formatConfigReportProgress config+#else+, formatConfigReportProgress = Latest.formatConfigUseColor config+#endif+++, formatConfigOutputUnicode = Latest.formatConfigOutputUnicode config , formatConfigUseDiff = Latest.formatConfigUseDiff config++#if MIN_VERSION_hspec_core(2,10,6)+, formatConfigDiffContext = Latest.formatConfigDiffContext config+, formatConfigExternalDiff = Latest.formatConfigExternalDiff config+#else+, formatConfigDiffContext = Nothing+, formatConfigExternalDiff = Nothing+#endif+++#if MIN_VERSION_hspec_core(2,9,5)+, formatConfigPrettyPrint = Latest.formatConfigPrettyPrint config+#else+, formatConfigPrettyPrint = True+#endif++#if MIN_VERSION_hspec_core(2,10,0)+, formatConfigPrettyPrintFunction = Latest.formatConfigPrettyPrintFunction config+#else+, formatConfigPrettyPrintFunction = Nothing+#endif+ , formatConfigPrintTimes = Latest.formatConfigPrintTimes config , formatConfigHtmlOutput = Latest.formatConfigHtmlOutput config , formatConfigPrintCpuTime = Latest.formatConfigPrintCpuTime config , formatConfigUsedSeed = Latest.formatConfigUsedSeed config-#if MIN_VERSION_hspec_core(2,9,0) , formatConfigExpectedTotalCount = Latest.formatConfigExpectedTotalCount config-#else-, formatConfigExpectedTotalCount = Latest.formatConfigItemCount config-#endif }
src/Test/Hspec/Api/Formatters/V1.hs view
@@ -92,8 +92,4 @@  -- copy of Test.Hspec.Core.Runner.registerFormatter registerFormatter_ :: (String, FormatConfig -> IO Format) -> Config -> Config-#if MIN_VERSION_hspec_core(2,9,0) registerFormatter_ formatter config = config { configAvailableFormatters = formatter : configAvailableFormatters config }-#else-registerFormatter_ _ config = config-#endif
src/Test/Hspec/Api/Formatters/V2.hs view
@@ -21,7 +21,8 @@ module Test.Hspec.Api.Formatters.V2 (  -- * Register a formatter-  useFormatter+  registerFormatter+, useFormatter , formatterToFormat  -- * Formatters@@ -52,6 +53,7 @@ , getPendingCount , getFailCount , getTotalCount+, getExpectedTotalCount  , FailureRecord (..) , getFailMessages@@ -74,6 +76,8 @@ , withPendingColor , withFailColor +, outputUnicode+ , useDiff , diffContext , externalDiffAction@@ -102,17 +106,18 @@ #endif  -- |+-- Make a formatter available for use with @--format@.+registerFormatter :: (String, Formatter) -> Config -> Config+registerFormatter formatter = registerFormatter_ (fmap formatterToFormat formatter)++-- | -- Make a formatter available for use with @--format@ and use it by default. useFormatter :: (String, Formatter) -> Config -> Config useFormatter (fmap formatterToFormat -> formatter@(_, format)) config = (registerFormatter_ formatter config) { configFormat = Just format }  -- copy of Test.Hspec.Core.Runner.registerFormatter registerFormatter_ :: (String, FormatConfig -> IO Format) -> Config -> Config-#if MIN_VERSION_hspec_core(2,9,0) registerFormatter_ formatter config = config { configAvailableFormatters = formatter : configAvailableFormatters config }-#else-registerFormatter_ _ config = config-#endif  #if !MIN_VERSION_hspec_core(2,9,2) prettyPrint :: FormatM Bool