Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed screenshots running after after-hook #230

Merged
merged 1 commit into from
Jan 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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