From 988e50448cc4f8513a4ff7d78063db1bf1ccdea9 Mon Sep 17 00:00:00 2001 From: Chris Holt Date: Tue, 18 Aug 2015 17:53:49 -0500 Subject: [PATCH] fix for #209, screenshot taken after after instead of before --- src/canopy/runner.fs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/canopy/runner.fs b/src/canopy/runner.fs index 13367af6..51416267 100644 --- a/src/canopy/runner.fs +++ b/src/canopy/runner.fs @@ -89,23 +89,24 @@ let run () = stopWatch.Start() let runtest (suite : suite) (test : Test) = - if failed = false then - try - reporter.testStart test.Id - if System.Object.ReferenceEquals(test.Func, todo) then - reporter.todo () - else if System.Object.ReferenceEquals(test.Func, skipped) then - reporter.skip () - else + if failed = false then + reporter.testStart test.Id + if System.Object.ReferenceEquals(test.Func, todo) then + reporter.todo () + else if System.Object.ReferenceEquals(test.Func, skipped) then + reporter.skip () + else + try try suite.Before () test.Func () - finally - suite.After () - pass() - with - | ex when failureMessage <> null && failureMessage = ex.Message -> pass() - | ex -> fail ex test.Id <| safelyGetUrl() + with + | ex when failureMessage <> null && failureMessage = ex.Message -> pass() + | ex -> fail ex test.Id <| safelyGetUrl() + finally + suite.After () + pass() + reporter.testEnd test.Id failureMessage <- null