chuchu 0.4.1 → 0.4.2
raw patch · 3 files changed
+20/−12 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- chuchu.cabal +1/−1
- src/Test/Chuchu.hs +7/−6
- src/Test/Chuchu/OutputPrinter.hs +12/−5
chuchu.cabal view
@@ -1,5 +1,5 @@ name: chuchu-version: 0.4.1+version: 0.4.2 cabal-version: >= 1.8 build-type: Simple license: OtherLicense
src/Test/Chuchu.hs view
@@ -234,16 +234,17 @@ parseStep <- ask case parseStep step of Left e -> do- putDoc $ describeStep UnknownStep step- liftIO $ warn $ concat [ "The step "- , show (stBody step)- , " doesn't match any step definitions I know."- , show e ]+ let msg = concat [ "The step "+ , show (stBody step)+ , " doesn't match any step definitions I know."+ , show e ]+ putDoc $ describeStep (UnknownStep msg) step return False Right m -> do r <- E.catches (lift m >> return SuccessfulStep) [ E.Handler $ \(e :: E.AsyncException) -> E.throw (e :: E.AsyncException)- , E.Handler $ \(_ :: E.SomeException) -> return FailedStep ]+ , E.Handler $ \(e :: E.SomeException) ->+ return (FailedStep $ "Caught exception: " ++ show e) ] putDoc (describeStep r step) return (r == SuccessfulStep)
src/Test/Chuchu/OutputPrinter.hs view
@@ -65,10 +65,17 @@ describeStep :: StepResult -> Step -> D.Doc describeStep result step = D.indent 4 $- color result (D.text (show $ stStepKeyword step) D.<+> t2d (stBody step))+ D.vsep $ [color result (D.text (show $ stStepKeyword step) D.<+> t2d (stBody step))]+ ++ map D.text (errMsg result) where- color SuccessfulStep = D.green- color FailedStep = D.red- color UnknownStep = D.yellow+ color SuccessfulStep = D.green+ color (FailedStep _) = D.red+ color (UnknownStep _) = D.yellow+ errMsg SuccessfulStep = []+ errMsg (FailedStep m) = [m]+ errMsg (UnknownStep m) = [m] -data StepResult = SuccessfulStep | FailedStep | UnknownStep deriving (Eq)+data StepResult = SuccessfulStep+ | FailedStep String+ | UnknownStep String+ deriving (Eq)