Shorten ExpectationFailedError to ExpectationFailed

This commit is contained in:
Michael Miller 2018-09-15 11:05:11 -06:00
parent a1871ca62e
commit b5cdda4af3
4 changed files with 7 additions and 7 deletions

View file

@ -13,13 +13,13 @@ module Spectator
def to(matcher : Matchers::Matcher)
unless matcher.match?(self)
raise ExpectationFailedError.new
raise ExpectationFailed.new
end
end
def to_not(matcher : Matchers::Matcher)
if matcher.match?(self)
raise ExpectationFailedError.new
raise ExpectationFailed.new
end
end

View file

@ -0,0 +1,4 @@
module Spectator
class ExpectationFailed < Exception
end
end

View file

@ -1,4 +0,0 @@
module Spectator
class ExpectationFailedError < Exception
end
end

View file

@ -37,7 +37,7 @@ module Spectator
case (error = result.error)
when Nil
SuccessfulExampleResult.new(self, result.elapsed)
when ExpectationFailedError
when ExpectationFailed
FailedExampleResult.new(self, result.elapsed, error)
else
ErroredExampleResult.new(self, result.elapsed, error)