ExpectationFailed exception takes a result

This commit is contained in:
Michael Miller 2018-10-07 13:45:36 -06:00
parent 73a0d51c1b
commit e14babc014
1 changed files with 10 additions and 0 deletions

View File

@ -1,4 +1,14 @@
module Spectator
# Exception that indicates a required expectation was not met in an example.
class ExpectationFailed < Exception
# Outcome of the expectation.
# Additional information can be retrieved through this.
getter result : Expectations::Expectation::Result
# Creates the exception.
# The exception string is generated from the expecation message.
def initialize(@result)
super(@result.actual_message)
end
end
end