Insert example failed exception

This commit is contained in:
Michael Miller 2018-10-19 20:58:14 -06:00
parent 2992a18992
commit 686304f31d
3 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,5 @@
module Spectator
# Exception that indicates an example failed and should abort.
class ExampleFailed < Exception
end
end

View file

@ -1,6 +1,8 @@
require "./example_failed"
module Spectator
# Exception that indicates a required expectation was not met in an example.
class ExpectationFailed < Exception
class ExpectationFailed < ExampleFailed
# Outcome of the expectation.
# Additional information can be retrieved through this.
getter result : Expectations::Expectation::Result

View file

@ -23,6 +23,7 @@ require "./example_group"
require "./nested_example_group"
require "./root_example_group"
require "./example_failed"
require "./expectation_failed"
require "./test_results"
require "./runner"