mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Capture exception from failed specs
This commit is contained in:
parent
3aa6ab7a10
commit
65b16f9031
2 changed files with 7 additions and 2 deletions
|
@ -2,8 +2,13 @@ require "./example_result"
|
|||
|
||||
module Spectator
|
||||
class FailedExampleResult < ExampleResult
|
||||
getter error : Exception
|
||||
|
||||
def passed? : Bool
|
||||
false
|
||||
end
|
||||
|
||||
def initialize(@example, @error)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,8 +19,8 @@ module Spectator
|
|||
private def run_example(example)
|
||||
example.run
|
||||
SuccessfulExampleResult.new(example)
|
||||
rescue
|
||||
FailedExampleResult.new(example)
|
||||
rescue ex : Exception
|
||||
FailedExampleResult.new(example, ex)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue