mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Shorten ExpectationFailedError to ExpectationFailed
This commit is contained in:
parent
a1871ca62e
commit
b5cdda4af3
4 changed files with 7 additions and 7 deletions
|
@ -13,13 +13,13 @@ module Spectator
|
||||||
|
|
||||||
def to(matcher : Matchers::Matcher)
|
def to(matcher : Matchers::Matcher)
|
||||||
unless matcher.match?(self)
|
unless matcher.match?(self)
|
||||||
raise ExpectationFailedError.new
|
raise ExpectationFailed.new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_not(matcher : Matchers::Matcher)
|
def to_not(matcher : Matchers::Matcher)
|
||||||
if matcher.match?(self)
|
if matcher.match?(self)
|
||||||
raise ExpectationFailedError.new
|
raise ExpectationFailed.new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
4
src/spectator/expectation_failed.cr
Normal file
4
src/spectator/expectation_failed.cr
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
module Spectator
|
||||||
|
class ExpectationFailed < Exception
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,4 +0,0 @@
|
||||||
module Spectator
|
|
||||||
class ExpectationFailedError < Exception
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -37,7 +37,7 @@ module Spectator
|
||||||
case (error = result.error)
|
case (error = result.error)
|
||||||
when Nil
|
when Nil
|
||||||
SuccessfulExampleResult.new(self, result.elapsed)
|
SuccessfulExampleResult.new(self, result.elapsed)
|
||||||
when ExpectationFailedError
|
when ExpectationFailed
|
||||||
FailedExampleResult.new(self, result.elapsed, error)
|
FailedExampleResult.new(self, result.elapsed, error)
|
||||||
else
|
else
|
||||||
ErroredExampleResult.new(self, result.elapsed, error)
|
ErroredExampleResult.new(self, result.elapsed, error)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue