ExpectationFailed exception takes a result
This commit is contained in:
parent
73a0d51c1b
commit
e14babc014
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue