Skip to content

Commit

Permalink
Fixed screenshots running after after-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenOen committed Jan 18, 2016
1 parent 9beed33 commit f1a7950
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/canopy/runner.fs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ let failSuite (ex: Exception) (suite : suite) =
|> List.rev
|> List.iter (fun test -> reportFailedTest ex test)

let tryTest test suite func =
try
func ()
with
| ex when failureMessage <> null && failureMessage = ex.Message -> pass()
| ex -> fail ex test suite <| safelyGetUrl()

let run () =
reporter.suiteBegin()
let stopWatch = new Diagnostics.Stopwatch()
Expand All @@ -113,17 +120,9 @@ let run () =
else if skipNextTest = true then
skip test.Id
else
try
try
suite.Before ()
test.Func ()
finally
suite.After ()
pass()
with
| ex when failureMessage <> null && failureMessage = ex.Message -> pass()
| ex -> fail ex test suite <| safelyGetUrl()

tryTest test suite (suite.Before >> test.Func)
tryTest test suite (suite.After >> pass)

reporter.testEnd test.Id

failureMessage <- null
Expand Down

0 comments on commit f1a7950

Please sign in to comment.