packages feed

hspec-meta 1.12.0 → 1.12.1

raw patch · 3 files changed

+16/−12 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

hspec-discover/src/Config.hs view
@@ -12,20 +12,22 @@   configNested :: Bool , configFormatter :: Maybe String , configNoMain :: Bool+, configModuleName :: Maybe String } deriving (Eq, Show)  defaultConfig :: Config-defaultConfig = Config False Nothing False+defaultConfig = Config False Nothing False Nothing  options :: [OptDescr (Config -> Config)] options = [-    Option [] ["nested"]    (NoArg  $ \c -> c   {configNested = True}) ""+    Option [] ["nested"] (NoArg $ \c -> c {configNested = True}) ""   , Option [] ["formatter"] (ReqArg (\s c -> c {configFormatter = Just s}) "FORMATTER") ""-  , Option [] ["no-main"]   (NoArg  $ \c -> c   {configNoMain = True}) ""+  , Option [] ["module-name"] (ReqArg (\s c -> c {configModuleName = Just s}) "NAME") ""+  , Option [] ["no-main"] (NoArg $ \c   -> c {configNoMain = True}) ""   ]  usage :: String -> String-usage prog = "\nUsage: " ++ prog ++ " SRC CUR DST [--formatter=FORMATTER] [--no-main]\n"+usage prog = "\nUsage: " ++ prog ++ " SRC CUR DST [--module-name=NAME]\n"  parseConfig :: String -> [String] -> Either String Config parseConfig prog args = case getOpt Permute options args of
hspec-discover/src/Run.hs view
@@ -59,6 +59,8 @@   . importList nodes   . showString "import Test.Hspec.Meta\n"   . maybe driver driverWithFormatter (configFormatter c)+  . showString "spec :: Spec\n"+  . showString "spec = "   . formatSpecs nodes   ) "\n"   where@@ -66,11 +68,9 @@         case configNoMain c of           False ->               showString "main :: IO ()\n"-            . showString "main = hspec $ "-          True ->-              showString "spec :: Spec\n"-            . showString "spec = "-    module_ = if configNoMain c then pathToModule src else "Main"+            . showString "main = hspec spec\n"+          True -> ""+    module_ = fromMaybe (if configNoMain c then pathToModule src else "Main") (configModuleName c)     pathToModule f = let         fileName = last $ splitDirectories f         m:ms = takeWhile (/='.') fileName@@ -82,7 +82,7 @@ driverWithFormatter f =     showString "import qualified " . showString (moduleName f) . showString "\n"   . showString "main :: IO ()\n"-  . showString "main = hspecWithFormatter " . showString f . showString " $ "+  . showString "main = hspecWithFormatter " . showString f . showString " spec\n"  moduleName :: String -> String moduleName = reverse . dropWhile (== '.') . dropWhile (/= '.') . reverse
hspec-meta.cabal view
@@ -1,5 +1,5 @@ name:             hspec-meta-version:          1.12.0+version:          1.12.1 license:          MIT license-file:     LICENSE copyright:        (c) 2011-2014 Simon Hengel,@@ -7,7 +7,7 @@                   (c) 2011 Greg Weber maintainer:       Simon Hengel <sol@typeful.net> build-type:       Simple-cabal-version:    >= 1.8+cabal-version:    >= 1.10 category:         Testing stability:        experimental bug-reports:      https://github.com/hspec/hspec/issues@@ -69,6 +69,7 @@       Test.Hspec.Runner.Tree       Test.Hspec.Formatters.Internal       Test.Hspec.Timer+  default-language: Haskell2010  executable hspec-meta-discover   ghc-options:@@ -84,3 +85,4 @@       base == 4.*     , filepath     , directory+  default-language: Haskell2010