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
|
module Spectator
|
||||||
class FailedExampleResult < ExampleResult
|
class FailedExampleResult < ExampleResult
|
||||||
|
getter error : Exception
|
||||||
|
|
||||||
def passed? : Bool
|
def passed? : Bool
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def initialize(@example, @error)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,8 +19,8 @@ module Spectator
|
||||||
private def run_example(example)
|
private def run_example(example)
|
||||||
example.run
|
example.run
|
||||||
SuccessfulExampleResult.new(example)
|
SuccessfulExampleResult.new(example)
|
||||||
rescue
|
rescue ex : Exception
|
||||||
FailedExampleResult.new(example)
|
FailedExampleResult.new(example, ex)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue