shard-spectator/src/spectator/expectation_failed.cr

16 lines
439 B
Crystal
Raw Normal View History

2018-10-20 02:58:14 +00:00
require "./example_failed"
module Spectator
# Exception that indicates a required expectation was not met in an example.
2018-10-20 02:58:14 +00:00
class ExpectationFailed < ExampleFailed
# Expectation that failed.
getter expectation : Expectations::Expectation
# Creates the exception.
# The exception string is generated from the expecation message.
def initialize(@expectation)
super(@expectation.actual_message)
end
end
end